add upAxis option for Y or Z up
remove some warnings
This commit is contained in:
@@ -15,6 +15,7 @@ uniform mat4 ModelViewMatrix;
|
||||
uniform mat4 ProjectionMatrix;
|
||||
uniform mat4 DepthBiasModelViewProjectionMatrix;
|
||||
uniform mat4 MVP;
|
||||
uniform vec3 lightDirIn;
|
||||
|
||||
out vec4 ShadowCoord;
|
||||
|
||||
@@ -65,13 +66,12 @@ void main(void)
|
||||
{
|
||||
vec4 q = instance_quaternion;
|
||||
ambient = vec3(0.3,.3,0.3);
|
||||
|
||||
|
||||
|
||||
vec4 worldNormal = (quatRotate3( vertexnormal,q));
|
||||
vec3 light_pos = vec3(-5.f,100,-40);
|
||||
|
||||
normal = normalize(worldNormal).xyz;
|
||||
|
||||
lightDir = normalize(light_pos);//gl_LightSource[0].position.xyz));
|
||||
lightDir = lightDirIn;
|
||||
|
||||
vec4 axis = vec4(1,1,1,0);
|
||||
vec4 localcoord = quatRotate3( position.xyz*instance_scale,q);
|
||||
|
||||
@@ -13,6 +13,7 @@ static const char* useShadowMapInstancingVertexShader= \
|
||||
"uniform mat4 ProjectionMatrix;\n"
|
||||
"uniform mat4 DepthBiasModelViewProjectionMatrix;\n"
|
||||
"uniform mat4 MVP;\n"
|
||||
"uniform vec3 lightDirIn;\n"
|
||||
"out vec4 ShadowCoord;\n"
|
||||
"out Fragment\n"
|
||||
"{\n"
|
||||
@@ -55,12 +56,11 @@ static const char* useShadowMapInstancingVertexShader= \
|
||||
"{\n"
|
||||
" vec4 q = instance_quaternion;\n"
|
||||
" ambient = vec3(0.3,.3,0.3);\n"
|
||||
" \n"
|
||||
" \n"
|
||||
" \n"
|
||||
" vec4 worldNormal = (quatRotate3( vertexnormal,q));\n"
|
||||
" vec3 light_pos = vec3(-5.f,100,-40);\n"
|
||||
" \n"
|
||||
" normal = normalize(worldNormal).xyz;\n"
|
||||
" lightDir = normalize(light_pos);//gl_LightSource[0].position.xyz));\n"
|
||||
" lightDir = lightDirIn;\n"
|
||||
" \n"
|
||||
" vec4 axis = vec4(1,1,1,0);\n"
|
||||
" vec4 localcoord = quatRotate3( position.xyz*instance_scale,q);\n"
|
||||
|
||||
Reference in New Issue
Block a user