Skip to content

Commit

Permalink
Update PBRLighting.frag
Browse files Browse the repository at this point in the history
  • Loading branch information
yaRnMcDonuts authored Feb 1, 2025
1 parent 16fe8aa commit 7c57779
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
uniform vec4 g_LightData[NB_LIGHTS];
uniform vec3 g_CameraPosition;

#ifdef USE_FOG
#import "MatDefs/ShaderLib/MaterialFog.glsllib"
#endif

void main(){
vec3 wpos = PBRLightingUtils_getWorldPosition();
vec3 worldViewDir = normalize(g_CameraPosition - wpos);
Expand Down Expand Up @@ -54,6 +58,10 @@ void main(){
gl_FragColor.rgb += surface.envLightContribution;
gl_FragColor.rgb += surface.emission;
gl_FragColor.a = surface.alpha;

#ifdef USE_FOG
gl_FragColor = MaterialFog_calculateFogColor(vec4(gl_FragColor));
#endif

//outputs the final value of the selected layer as a color for debug purposes.
#ifdef DEBUG_VALUES_MODE
Expand Down

0 comments on commit 7c57779

Please sign in to comment.