Dear all,
I try to create an FX-Shader for interactive walkthroughs which has the same math as the VrayMaterial. Especially the blending between Diffuse and Reflect Color slot is interesting. I tried to figure out the math with some testscenes but the result is not exact to me.
So I assume the following for simplification:
-no fresnel
-diffuse is just a color, no texture
-reflection is also a color, no greyscale value, but also no texture
-put together diffuse and incoming light as a baked VrayRawTotalLightMap, in my formula it is the diffuse value
So which of the following terms is the correct one?
1. resultColor = lerp(diffuseColor, env_reflection * reflectionColor, intensityFromRGBFloat(reflectionColor));
2. resultColor = lerp(diffuseColor, env_reflection, intensityFromRGBFloat(reflectionColor));
3. resultColor = lerp(diffuseColor, env_reflection * reflectionColor, reflectionColor);
4. resultColor = lerp(diffuseColor, env_reflection, reflectionColor);
Thank you much in advance.
I try to create an FX-Shader for interactive walkthroughs which has the same math as the VrayMaterial. Especially the blending between Diffuse and Reflect Color slot is interesting. I tried to figure out the math with some testscenes but the result is not exact to me.
So I assume the following for simplification:
-no fresnel
-diffuse is just a color, no texture
-reflection is also a color, no greyscale value, but also no texture
-put together diffuse and incoming light as a baked VrayRawTotalLightMap, in my formula it is the diffuse value
So which of the following terms is the correct one?
1. resultColor = lerp(diffuseColor, env_reflection * reflectionColor, intensityFromRGBFloat(reflectionColor));
2. resultColor = lerp(diffuseColor, env_reflection, intensityFromRGBFloat(reflectionColor));
3. resultColor = lerp(diffuseColor, env_reflection * reflectionColor, reflectionColor);
4. resultColor = lerp(diffuseColor, env_reflection, reflectionColor);
Thank you much in advance.
Comment