Add shader for projective texture.
This commit is contained in:
6
examples/OpenGLWindow/Shaders/useShadowMapInstancingVS.glsl
Normal file → Executable file
6
examples/OpenGLWindow/Shaders/useShadowMapInstancingVS.glsl
Normal file → Executable file
@@ -11,6 +11,8 @@ layout (location = 5) in vec4 instance_color;
|
||||
layout (location = 6) in vec3 instance_scale;
|
||||
|
||||
|
||||
uniform mat4 ModelViewMatrix;
|
||||
uniform mat4 ProjectionMatrix;
|
||||
uniform mat4 DepthBiasModelViewProjectionMatrix;
|
||||
uniform mat4 MVP;
|
||||
uniform vec3 lightPosIn;
|
||||
@@ -91,9 +93,9 @@ void main(void)
|
||||
|
||||
vec4 vertexLoc = MVP* vec4((instance_position+localcoord).xyz,1);
|
||||
gl_Position = vertexLoc;
|
||||
ShadowCoord = DepthBiasModelViewProjectionMatrix * vec4((instance_position+localcoord).xyz,1);
|
||||
|
||||
fragment.color = instance_color;
|
||||
vec4 projcoords = DepthBiasModelViewProjectionMatrix * vec4((instance_position+localcoord).xyz,1);
|
||||
vert.texcoord = projcoords.xy;
|
||||
vert.texcoord = uvcoords;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user