diff options
Diffstat (limited to 'system/shaders/GLES/2.0')
-rw-r--r-- | system/shaders/GLES/2.0/gles_shader.vert | 2 | ||||
-rw-r--r-- | system/shaders/GLES/2.0/gles_shader_clip.vert | 4 | ||||
-rw-r--r-- | system/shaders/GLES/2.0/gles_shader_simple.vert | 4 | ||||
-rw-r--r-- | system/shaders/GLES/2.0/gles_yuv2rgb.vert | 1 |
4 files changed, 11 insertions, 0 deletions
diff --git a/system/shaders/GLES/2.0/gles_shader.vert b/system/shaders/GLES/2.0/gles_shader.vert index 890acbbb81..17b4ad7b48 100644 --- a/system/shaders/GLES/2.0/gles_shader.vert +++ b/system/shaders/GLES/2.0/gles_shader.vert @@ -30,11 +30,13 @@ varying lowp vec4 m_colour; uniform mat4 m_proj; uniform mat4 m_model; uniform mat4 m_coord0Matrix; +uniform float m_depth; void main () { mat4 mvp = m_proj * m_model; gl_Position = mvp * m_attrpos; + gl_Position.z = m_depth * gl_Position.w; m_colour = m_attrcol; m_cord0 = m_coord0Matrix * m_attrcord0; m_cord1 = m_attrcord1; diff --git a/system/shaders/GLES/2.0/gles_shader_clip.vert b/system/shaders/GLES/2.0/gles_shader_clip.vert index 513a24456c..1b1cf3f91e 100644 --- a/system/shaders/GLES/2.0/gles_shader_clip.vert +++ b/system/shaders/GLES/2.0/gles_shader_clip.vert @@ -18,6 +18,7 @@ varying vec4 m_colour; uniform mat4 m_matrix; uniform vec4 m_shaderClip; uniform vec4 m_cordStep; +uniform float m_depth; // this shader can be used in cases where clipping via glScissor() is not // possible (e.g. when rotating). it can't discard triangles, but it may @@ -30,6 +31,9 @@ void main() position.xy = clamp(position.xy, m_shaderClip.xy, m_shaderClip.zw); gl_Position = m_matrix * position; + // set rendering depth + gl_Position.z = m_depth * gl_Position.w; + // correct texture coordinates for clipped vertices vec2 clipDist = m_attrpos.xy - position.xy; m_cord0.xy = m_attrcord0.xy - clipDist * m_cordStep.xy; diff --git a/system/shaders/GLES/2.0/gles_shader_simple.vert b/system/shaders/GLES/2.0/gles_shader_simple.vert index 6d49788b65..2f34f8bf28 100644 --- a/system/shaders/GLES/2.0/gles_shader_simple.vert +++ b/system/shaders/GLES/2.0/gles_shader_simple.vert @@ -16,10 +16,14 @@ varying vec4 m_cord0; varying vec4 m_cord1; varying vec4 m_colour; uniform mat4 m_matrix; +uniform float m_depth; void main() { gl_Position = m_matrix * m_attrpos; + + // set rendering depth + gl_Position.z = m_depth * gl_Position.w; m_colour = m_attrcol; m_cord0 = m_attrcord0; m_cord1 = m_attrcord1; diff --git a/system/shaders/GLES/2.0/gles_yuv2rgb.vert b/system/shaders/GLES/2.0/gles_yuv2rgb.vert index bc437afdc3..c96a6a9585 100644 --- a/system/shaders/GLES/2.0/gles_yuv2rgb.vert +++ b/system/shaders/GLES/2.0/gles_yuv2rgb.vert @@ -34,6 +34,7 @@ void main () { mat4 mvp = m_proj * m_model; gl_Position = mvp * m_attrpos; + gl_Position.z = -1. * gl_Position.w; m_cordY = m_attrcordY; m_cordU = m_attrcordU; m_cordV = m_attrcordV; |