ChaosGroup / blender_with_vray_additions

Blender with patches for V-Ray *.vrscene export
Other
28 stars 13 forks source link

Socket multiplier clamping texture values #268

Open mmdanggg2 opened 5 years ago

mmdanggg2 commented 5 years ago

I've was trying to use the Water texture as a bump map and found it had flat areas that I wasn't seeing when i did the same setup in V-Ray for Rhino. After digging through the .vrscene the only major difference was the blender version is adding TexCombineColor nodes between each connection for the multiplier. Manually removing these fixed the issue.

After further testing, the TexCombineColor node is clamping values below 0, causing half of the blue channel in the Water texture to be lost. You can't even add .5 to bring it above or do anything to the Water texture output as it is always forced to go through the TexCombineColor node first making it quite useless.

Current: image Expected: image

I made a custom build changing this line: https://github.com/ChaosGroup/blender_with_vray_additions/blob/ac206ea015e912b6529d9b637a1e0466edaaa6d7/intern/vray_for_blender_rt/src/scene_exporter/vfb_node_attributes.cpp#L305

&& texMult != 1.0f

To ignore the multiplier if it was 1 and this has been working for now but this seems like a major oversight. Probably the best fix would be to make TexCombineColor not clamp values below 0 but that's probably a v-ray core thing right?