How does material color multiplication works?
-
When material has a texture and color the result is really weird. It is not just texture and color multiplication as commonly seen in computer graphics. How does it work in Sketchup so I can reproduce it in other renderer?
Thanks
-
Material color multiplication? What do you mean?
-
SketchUp's UI has two ways to modify the color of a textured material: You can color-shift the texture image (it still preserves color differences, but with an emphasis at a different
Sketchup::Color
)
and you can colorize the texture image (boolean, preserves only the brightness, sets the hue and saturation to a specific color).The API does not differentiate between the two, so when you read
color
from a color-shifted material and set the same value again, it will be not just be color-shifted but colorized. It's better not to use these properties in Ruby scripts.You can however "bake" the color-shift/colorization into a texture when exporting textures with the
Sketchup::TextureWriter
. -
Ah! That color adjustment features.
The Colorize function just converts it to a grayscale and maps that to the selected color.
I'll look into the color shifting. I have always thought it was a blend going on - but I'll see if I can dig into the code and see what actually happens.
-
It does a HSL shift.
-
@tt_su said:
It does a HSL shift.
Hi,
If we have the original rgb texture, and the hls or rgb color of the texture, what is the opertion to do to each pixel to create the new material with color like the Sketchup texture writer???thanks
-
I would need the deltas, and know whether the material is HSL shifted or tinted - something the Ruby API doesn't expose right now. But we have an issue open to address that.
Advertisement