Fix #125219: Transmissive BSDF different in Blended and Dithered mode

for transmissive closures the color is squared, but Blended square
BEFORE the weight is applied, and Dithered square AFTER the weight is
applied, causing difference in the final color.

This fix aligns the behaviour of Blended with Dithered.

NOTE that this is a partial fix, because Dithered is also behaving
incorrectly. A more proper fix would be !125233.

Pull Request: https://projects.blender.org/blender/blender/pulls/125299
This commit is contained in:
Weizhen Huang
2024-07-23 19:40:14 +02:00
committed by Weizhen Huang
parent 6e152df547
commit 5cbc540a64

View File

@@ -79,7 +79,7 @@ void forward_lighting_eval(float thickness, out vec3 radiance, out vec3 transmit
vec3 radiance_direct = vec3(0.0);
vec3 radiance_indirect = vec3(0.0);
for (int i = 0; i < LIGHT_CLOSURE_EVAL_COUNT; i++) {
ClosureUndetermined cl = g_closure_get(i);
ClosureUndetermined cl = g_closure_get_resolved(i, 1.0);
if (cl.weight > 1e-5) {
vec3 direct_light = closure_light_get(stack, i).light_shadowed;
vec3 indirect_light = lightprobe_eval(samp, cl, g_data.P, V, thickness);
@@ -91,7 +91,6 @@ void forward_lighting_eval(float thickness, out vec3 radiance, out vec3 transmit
/* We model two transmission event, so the surface color need to be applied twice. */
cl.color *= cl.color;
}
cl.color *= cl.weight;
radiance_direct += direct_light * cl.color;
radiance_indirect += indirect_light * cl.color;