mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 12:04:55 +02:00
experimental map shaders
This commit is contained in:
18
modules/game_shaders/shaders/fog.frag
Normal file
18
modules/game_shaders/shaders/fog.frag
Normal file
@@ -0,0 +1,18 @@
|
||||
uniform float u_Time;
|
||||
uniform sampler2D u_Tex0;
|
||||
uniform sampler2D u_Tex1;
|
||||
varying vec2 v_TexCoord;
|
||||
|
||||
vec2 direction = vec2(1.0,0.3);
|
||||
float speed = 0.05;
|
||||
float pressure = 0.6;
|
||||
float zoom = 0.5;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vec2 offset = (v_TexCoord + (direction * u_Time * speed)) / zoom;
|
||||
vec3 bgcol = texture2D(u_Tex0, v_TexCoord).xyz;
|
||||
vec3 fogcol = texture2D(u_Tex1, offset).xyz;
|
||||
vec3 col = bgcol + fogcol*pressure;
|
||||
gl_FragColor = vec4(col,1.0);
|
||||
}
|
Reference in New Issue
Block a user