diff options
author | Vitaliy <silverunicorn2011@yandex.ru> | 2017-10-31 21:27:10 +0300 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-10-31 19:27:10 +0100 |
commit | 28841961ba91b943b7478704181604fa3e24e81e (patch) | |
tree | 6485c0d4483c1c1e20eefd80510b7e9441f1b58a /client/shaders | |
parent | 65c5539035139428ee8354d7c96565fc392112d2 (diff) | |
download | minetest-28841961ba91b943b7478704181604fa3e24e81e.tar.gz minetest-28841961ba91b943b7478704181604fa3e24e81e.tar.bz2 minetest-28841961ba91b943b7478704181604fa3e24e81e.zip |
Rewrite rendering engine (#6253)
* Clean draw_*() arguments
* Split rendering core
* Add anaglyph 3D
* Interlaced 3D
* Drop obsolete methods
Diffstat (limited to 'client/shaders')
-rw-r--r-- | client/shaders/3d_interlaced_merge/opengl_fragment.glsl | 21 | ||||
-rw-r--r-- | client/shaders/3d_interlaced_merge/opengl_vertex.glsl | 6 |
2 files changed, 27 insertions, 0 deletions
diff --git a/client/shaders/3d_interlaced_merge/opengl_fragment.glsl b/client/shaders/3d_interlaced_merge/opengl_fragment.glsl new file mode 100644 index 000000000..25945ad7f --- /dev/null +++ b/client/shaders/3d_interlaced_merge/opengl_fragment.glsl @@ -0,0 +1,21 @@ +uniform sampler2D baseTexture; +uniform sampler2D normalTexture; +uniform sampler2D textureFlags; + +#define leftImage baseTexture +#define rightImage normalTexture +#define maskImage textureFlags + +void main(void) +{ + vec2 uv = gl_TexCoord[0].st; + vec4 left = texture2D(leftImage, uv).rgba; + vec4 right = texture2D(rightImage, uv).rgba; + vec4 mask = texture2D(maskImage, uv).rgba; + vec4 color; + if (mask.r > 0.5) + color = right; + else + color = left; + gl_FragColor = color; +} diff --git a/client/shaders/3d_interlaced_merge/opengl_vertex.glsl b/client/shaders/3d_interlaced_merge/opengl_vertex.glsl new file mode 100644 index 000000000..4e0b2b125 --- /dev/null +++ b/client/shaders/3d_interlaced_merge/opengl_vertex.glsl @@ -0,0 +1,6 @@ +void main(void) +{ + gl_TexCoord[0] = gl_MultiTexCoord0; + gl_Position = gl_Vertex; + gl_FrontColor = gl_BackColor = gl_Color; +} |