From 425decdf7e9284d15aa726e3ae96b9942fb0e3ea Mon Sep 17 00:00:00 2001 From: IronClawTrem Date: Sun, 16 Feb 2020 03:40:06 +0000 Subject: create tremded branch --- src/renderergl2/glsl/shadowmask_vp.glsl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/renderergl2/glsl/shadowmask_vp.glsl (limited to 'src/renderergl2/glsl/shadowmask_vp.glsl') diff --git a/src/renderergl2/glsl/shadowmask_vp.glsl b/src/renderergl2/glsl/shadowmask_vp.glsl new file mode 100644 index 0000000..13166a2 --- /dev/null +++ b/src/renderergl2/glsl/shadowmask_vp.glsl @@ -0,0 +1,18 @@ +attribute vec4 attr_Position; +attribute vec4 attr_TexCoord0; + +uniform vec3 u_ViewForward; +uniform vec3 u_ViewLeft; +uniform vec3 u_ViewUp; +uniform vec4 u_ViewInfo; // zfar / znear + +varying vec2 var_DepthTex; +varying vec3 var_ViewDir; + +void main() +{ + gl_Position = attr_Position; + vec2 screenCoords = gl_Position.xy / gl_Position.w; + var_DepthTex = attr_TexCoord0.xy; + var_ViewDir = u_ViewForward + u_ViewLeft * -screenCoords.x + u_ViewUp * screenCoords.y; +} -- cgit