prefect
e2bbd9a654
This is a huge patch, including: * add a LitRenderModifier abstract base class for RenderModifiers with shadow+light * add LitRenderModifiers for all types of models * add STREAM_TEXGENTOUV1 to request generation of shadow map texcoords for models * create facilities to pass the texture matrix from the RenderModifier (fragment stage) to the ModelRenderer (vertex stage) * split ambient and diffuse terms of lighting until further down in the pipeline; this is necessary since shadowed regions receive only ambient light * small improvement in how RenderPathVertexShader scales to a greater number of vertex shaders This was SVN commit r3690.
18 lines
428 B
GLSL
18 lines
428 B
GLSL
vec3 lighting(vec3 normal);
|
|
|
|
vec3 InstancingNormal(vec3 normal);
|
|
vec4 InstancingPosition(vec4 position);
|
|
|
|
vec4 postouv1(vec4 pos);
|
|
|
|
void main()
|
|
{
|
|
vec3 normal = InstancingNormal(gl_Normal);
|
|
vec4 worldPos = InstancingPosition(gl_Vertex);
|
|
|
|
gl_FrontColor = vec4(lighting(normal),1.0) * gl_Color;
|
|
gl_TexCoord[0] = gl_MultiTexCoord0;
|
|
gl_TexCoord[1] = postouv1(worldPos);
|
|
gl_Position = gl_ModelViewProjectionMatrix * worldPos;
|
|
}
|