Skip to content

Commit 6a24bd5

Browse files
committed
fix some shader compiler weirdness in fallback functions
1 parent 1e654c2 commit 6a24bd5

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Shaders/LTCGI.cginc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,13 @@ void LTCGI_Contribution(
180180
totalDiffuseIntensity = 0;
181181
#endif
182182

183+
#ifdef LTCGI_SPECULAR_OFF
184+
specular = 0;
185+
#endif
186+
#ifdef LTCGI_DIFFUSE_OFF
187+
diffuse = 0;
188+
#endif
189+
183190
[branch]
184191
if (_Udon_LTCGI_GlobalEnable == 0.0f) {
185192
return;
@@ -352,21 +359,24 @@ void LTCGI_Contribution(
352359

353360
#ifndef LTCGI_API_V2
354361

362+
// missing totalSpecularIntensity, totalDiffuseIntensity, specular
355363
void LTCGI_Contribution(
356364
float3 worldPos, float3 worldNorm, float3 viewDir, float roughness, float2 lmuv, inout half3 diffuse
357365
) {
358-
half3 _u1;
366+
half3 _u1 = (half3)0;
359367
float _u2, _u3;
360368
LTCGI_Contribution(worldPos, worldNorm, viewDir, roughness, lmuv, diffuse, _u1, _u2, _u3);
361369
}
362370

371+
// missing totalSpecularIntensity, totalDiffuseIntensity
363372
void LTCGI_Contribution(
364373
float3 worldPos, float3 worldNorm, float3 viewDir, float roughness, float2 lmuv, inout half3 diffuse, inout half3 specular
365374
) {
366375
float _u1, _u2;
367376
LTCGI_Contribution(worldPos, worldNorm, viewDir, roughness, lmuv, diffuse, specular, _u1, _u2);
368377
}
369378

379+
// missing totalDiffuseIntensity
370380
void LTCGI_Contribution(
371381
float3 worldPos, float3 worldNorm, float3 viewDir, float roughness, float2 lmuv, inout half3 diffuse, inout half3 specular, out float totalSpecularIntensity
372382
) {

0 commit comments

Comments
 (0)