summaryrefslogtreecommitdiff
path: root/drivers/gles2
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-11-29 19:55:12 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-11-29 19:55:12 -0300
commita47c78aed113a9b4c009c5a2ef29c690192c7eef (patch)
tree93bed03fdf277a59a6cb10cc2ca9ef6a0f17ace6 /drivers/gles2
parent3f40701002254aeb20e20acbad0cd28a9b7476e3 (diff)
Screen space reflection effect
Diffstat (limited to 'drivers/gles2')
-rw-r--r--drivers/gles2/shaders/copy.glsl10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gles2/shaders/copy.glsl b/drivers/gles2/shaders/copy.glsl
index ae7185a1d6..cb42970921 100644
--- a/drivers/gles2/shaders/copy.glsl
+++ b/drivers/gles2/shaders/copy.glsl
@@ -71,6 +71,11 @@ uniform sampler2D source;
#endif
varying vec2 uv2_interp;
+
+#ifdef USE_DEPTH
+uniform highp sampler2D source_depth; //texunit:1
+#endif
+
#ifdef USE_GLOW
uniform sampler2D glow_source;
@@ -547,5 +552,10 @@ void main() {
gl_FragColor = color;
+
+#ifdef USE_DEPTH
+ gl_FragDepth = texture(source_depth,uv_interp).r;
+#endif
+
}