Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/shaders/glsl/waves.fs
Show All 30 Lines | void main() | ||||
vec2 norm = Tex.rb; | vec2 norm = Tex.rb; | ||||
Tex.r = norm.x * normal.x - norm.y * normal.x; | Tex.r = norm.x * normal.x - norm.y * normal.x; | ||||
Tex.b = norm.x * normal.y + norm.y * normal.y; | Tex.b = norm.x * normal.y + norm.y * normal.y; | ||||
vec3 foam = texture2D(foamTex, -gl_TexCoord[0].xy/vec2(2.5,7.0) + vec2(0.05,-0.3)*-cos(ttime/2.0)).rbg; | vec3 foam = texture2D(foamTex, -gl_TexCoord[0].xy/vec2(2.5,7.0) + vec2(0.05,-0.3)*-cos(ttime/2.0)).rbg; | ||||
foam *= texture2D(foamTex, -gl_TexCoord[0].xy/5.0 + vec2(0.8,-0.8) + vec2(-0.05,-0.25)*-cos(ttime/2.0)*1.2).rbg; | foam *= texture2D(foamTex, -gl_TexCoord[0].xy/5.0 + vec2(0.8,-0.8) + vec2(-0.05,-0.25)*-cos(ttime/2.0)*1.2).rbg; | ||||
Tex.g = foamAlpha * clamp(foam.r * 3.0, 0.0, 1.0) * 0.4; | |||||
gl_FragData[0] = vec4(Tex); | gl_FragColor = Tex; | ||||
gl_FragData[1] = vec4(foam*3.0,foamAlpha); | |||||
return; | |||||
} | } |
Wildfire Games · Phabricator