Skip to content

Commit d848f37

Browse files
authored
Explicitly initialize ltcgi_output.color for diffuse and specular (#33)
This should mitigate a compiler failure which commonly affects the Mochie Standard shader for some reason.
1 parent 92f82d6 commit d848f37

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Shaders/LTCGI.cginc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ void LTCGI_Contribution(
312312
lmd = smoothstep(0.0, LTCGI_SPECULAR_LIGHTMAP_STEP, saturate(lm - LTCGI_LIGHTMAP_CUTOFF));
313313
}
314314
ltcgi_output diff;
315+
diff.color = 0;
315316
LTCGI_Evaluate(input, worldNorm, viewDir, identityBrdf, roughness, true, diff);
316317
diff.intensity *= lmd;
317318

@@ -331,6 +332,7 @@ void LTCGI_Contribution(
331332
if (flags.specular)
332333
{
333334
ltcgi_output spec;
335+
spec.color = 0;
334336
LTCGI_Evaluate(input, worldNorm, viewDir, Minv, roughness, false, spec);
335337
spec.intensity *= spec_amp * smoothstep(0.0, LTCGI_SPECULAR_LIGHTMAP_STEP, saturate(lm - LTCGI_LIGHTMAP_CUTOFF));
336338

@@ -419,4 +421,4 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
419421
420422
*/
421423

422-
#endif
424+
#endif

0 commit comments

Comments
 (0)