Skip to content

Commit 7c57779

Browse files
authored
Update PBRLighting.frag
1 parent 16fe8aa commit 7c57779

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

jme3-core/src/main/resources/Common/MatDefs/Light/PBRLighting.frag

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
uniform vec4 g_LightData[NB_LIGHTS];
2020
uniform vec3 g_CameraPosition;
2121

22+
#ifdef USE_FOG
23+
#import "MatDefs/ShaderLib/MaterialFog.glsllib"
24+
#endif
25+
2226
void main(){
2327
vec3 wpos = PBRLightingUtils_getWorldPosition();
2428
vec3 worldViewDir = normalize(g_CameraPosition - wpos);
@@ -54,6 +58,10 @@ void main(){
5458
gl_FragColor.rgb += surface.envLightContribution;
5559
gl_FragColor.rgb += surface.emission;
5660
gl_FragColor.a = surface.alpha;
61+
62+
#ifdef USE_FOG
63+
gl_FragColor = MaterialFog_calculateFogColor(vec4(gl_FragColor));
64+
#endif
5765

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

0 commit comments

Comments
 (0)