diff options
author | Fathi Boudra <fathi.boudra@linaro.org> | 2013-03-30 17:38:14 +0200 |
---|---|---|
committer | Fathi Boudra <fathi.boudra@linaro.org> | 2013-03-30 17:38:14 +0200 |
commit | 341f04dca0008c290cf065c4b36348fd80fe9700 (patch) | |
tree | ab372775bee83fd6c6500c75fd066315f725981d /data/shaders/jellyfish.frag |
Imported Upstream version 2012.12HEADupstream/2012.12upstreammaster
Diffstat (limited to 'data/shaders/jellyfish.frag')
-rw-r--r-- | data/shaders/jellyfish.frag | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/data/shaders/jellyfish.frag b/data/shaders/jellyfish.frag new file mode 100644 index 0000000..62c9960 --- /dev/null +++ b/data/shaders/jellyfish.frag @@ -0,0 +1,21 @@ +#ifdef GL_ES +precision highp float; +#endif + +uniform sampler2D uSampler; +uniform sampler2D uSampler1; +uniform float uCurrentTime; + +varying vec2 vTextureCoord; +varying vec4 vWorld; +varying vec3 vDiffuse; +varying vec3 vAmbient; +varying vec3 vFresnel; + +void main(void) +{ + vec4 caustics = texture2D(uSampler1, vec2(vWorld.x / 24.0 + uCurrentTime / 20.0, (vWorld.z - vWorld.y)/48.0 + uCurrentTime / 40.0)); + vec4 colorMap = texture2D(uSampler, vTextureCoord); + float transparency = colorMap.a + pow(vFresnel.r, 2.0) - 0.3; + gl_FragColor = vec4(((vAmbient + vDiffuse + caustics.rgb) * colorMap.rgb), transparency); +} |