Skip to content

Commit ef2f221

Browse files
Fix GLSL implementation of BSDF addition (#2334)
This changelist fixes the computation of throughput in the GLSL implementation of BSDF addition, with a comment describing the motivation for the provided math.
1 parent 4e4c70f commit ef2f221

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

libraries/pbrlib/genglsl/mx_add_bsdf.glsl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
void mx_add_bsdf(ClosureData closureData, BSDF in1, BSDF in2, out BSDF result)
44
{
5+
// To provide a throughput computation for hardware shading languages,
6+
// we reinterpret BSDF addition as in1 + in2 = mix(in1, in2, 0.5) * 2.
57
result.response = in1.response + in2.response;
6-
result.throughput = in1.throughput + in2.throughput;
8+
result.throughput = mix(in1.throughput, in2.throughput, 0.5);
79
}

0 commit comments

Comments
 (0)