Skip to content

Commit

Permalink
Glow In The Dark fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Flimsy Fox committed May 16, 2024
1 parent 7153089 commit e44af11
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Flimsy Fox PBR.shader
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@

emissionMask = float4(tex2D (_EmissionMask, IN.uv));
emission = float4(tex2D (_Emission, IN.uv));
emission *= _EmissionColor * _EmissionStrength;

//AudioLink
if(_AudioLinkEnable &&
Expand All @@ -432,7 +433,6 @@
}
}
}
emission *= _EmissionColor * _EmissionStrength;

//PBR shading starts
float3 colorOut = float3(0,0,0);
Expand Down Expand Up @@ -543,12 +543,13 @@
}
}
colorOut /= _NumSamples;
lighting /= _NumSamples;

float glowInTheDark;
float3 glowInTheDark = 1;
if(_GlowInTheDarkEnable)
glowInTheDark = 1 - min(lighting + (1 - _GlowInTheDarkMax*_LightMult), 1);
else
glowInTheDark = 1;
{
glowInTheDark *= max(min(lighting - _GlowInTheDarkMax, 1), 0);
}
emission.r *= emissionMask.r;
emission.g *= emissionMask.g;
emission.b *= emissionMask.b;
Expand All @@ -558,7 +559,7 @@
//POST PROCESSING and final calculations
UNITY_APPLY_FOG(IN.fogCoord, colorOut);
//colorOut.a = origAlbedo.a;
//colorOut = float4(IN.worldViewDir, 1);
//colorOut = emission;

return fixed4(colorOut, origAlbedo.a);
}
Expand Down

0 comments on commit e44af11

Please sign in to comment.