Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difference in textures' images after import (SketchUp SDK 23.0.397.0 vs 2024.0.484.0/2024.0.553.0, Windows) #1000

Open
bohdansadovenko opened this issue Sep 10, 2024 · 3 comments

Comments

@bohdansadovenko
Copy link

After updating SketchUp SDK from 23.0.397.0 to 2024.0.484.0 textures were changed (same behavior for 2024.0.553.0).

After import all the data from sketchup file I’m trying to save appropriate textures’ images to files via next code:

SUTextureRef texture = SU_INVALID;
const auto get_texture_result = SUMaterialGetTexture(i_su_material, &texture);
if (get_texture_result != SU_ERROR_NO_DATA) {
  if (get_texture_result != SU_ERROR_NONE)
    throw std::runtime_error("unable to get texture from material");
  MSUString texture_file_name;
  if (SUTextureGetFileName(texture, &texture_file_name.Access()) != SU_ERROR_NONE)
    throw std::runtime_error("unable to get material name");
if (SUTextureWriteToFile(texture, i_file_name) != SU_ERROR_NONE)
  throw std::runtime_error("unable to store");

But results are different between different versions of SDK. Output images are visually similar but if I’m trying to compare them pixel-wise (each channel separately) difference can be more than 10 units from 255 for color channel.
Expeccted result (23.0.397.0):
expected
Actual result (2024.0.484.0):
actual

Visually difference looks insignificant, but on the whole model difference is easier to notice.

In latest SketchUp I found a flag that makes behavior exactly as same as in my workflow:

  • if flag is “enabled” (default behavior during opening file) - behavior looks similar to SketchUp API 2023
  • if flag is “disabled” - behavior looks similar to SketchUp API 2024
    As you can see “color”/texture is changed:
    flag

But I didn't find anything similar (I mean any flags, setters, etc.) in C-API. At least for me it looks like a bug cause behavior was changed in new version of the SketchUp SDK.

@thomthom
Copy link
Member

There was a few noticeable changes between SU23 and SU24. We changed the underlying library that handled images. That caused some very subtle differences. For instance +/-1 in the RGB channels for some pixels etc.

However, that should not cause the visual change in the viewport that you are seeing. That might be related to the new rendering engine. I'm not entirely sure. But if you can provide a sample model/code snippet to reproduce I can forward this internally for investigation.

@bohdansadovenko
Copy link
Author

Here you can find code which I use to reproduce. Just saves all the textures for input file:
CodeToReproduce.txt

Here you can find example of textures that differ:
Wood_Board_Cork_new
Wood_Board_Cork_old

Can't attach skp file - is there any other way to share it?

@bohdansadovenko
Copy link
Author

Hmm, a bit strange way to share input file - but :)
example.txt
(replace extension to *.skp and it should be needed one)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants