-
-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Perminder <[email protected]>
- Loading branch information
1 parent
dab63d4
commit 0c27224
Showing
5 changed files
with
81 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#version 120 | ||
|
||
varying vec2 UV; | ||
|
||
uniform sampler2D inRGBTex; | ||
|
||
uniform float fogR; | ||
uniform float fogG; | ||
uniform float fogB; | ||
|
||
uniform sampler2D inDepthTex; | ||
uniform float inFogStrength; | ||
uniform float uoffset; | ||
uniform float inFogPosition; | ||
|
||
vec4 applyFog(vec2 texCoord) { | ||
vec4 finalColor = mix( | ||
texture2D(inRGBTex, texCoord), | ||
vec4(vec3(fogR, fogG, fogB), 1.), | ||
pow(texture2D(inDepthTex, texCoord.xy).r, uoffset * inFogPosition/10.0) | ||
) + inFogStrength / 100.0; | ||
|
||
return finalColor; | ||
} | ||
|
||
|
||
void main() { | ||
|
||
vec4 foggedColor = applyFog(UV); | ||
|
||
gl_FragColor = foggedColor; | ||
gl_FragDepth = texture2D(inDepthTex, UV).x; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters