don't use GL_LINEAR_MIPMAP_LINEAR for shadow maps
optimize gpu upload (use glBufferSubData instead of glMapBuffer Avoid checking char array against zero.
This commit is contained in:
@@ -36,11 +36,9 @@ void main(void)
|
||||
|
||||
//float bias = 0.005f;
|
||||
|
||||
float bias = 0.0001*tan(acos(intensity));
|
||||
bias = clamp(bias, 0,0.01);
|
||||
|
||||
|
||||
|
||||
float visibility = texture(shadowMap, vec3(ShadowCoord.xy,(ShadowCoord.z-bias)/ShadowCoord.w));
|
||||
float visibility = texture(shadowMap, vec3(ShadowCoord.xy,(ShadowCoord.z)/ShadowCoord.w));
|
||||
|
||||
intensity = 0.7*intensity + 0.3*intensity*visibility;
|
||||
|
||||
|
||||
@@ -30,9 +30,8 @@ static const char* useShadowMapInstancingFragmentShader= \
|
||||
" \n"
|
||||
" //float bias = 0.005f;\n"
|
||||
" \n"
|
||||
" float bias = 0.0001*tan(acos(intensity));\n"
|
||||
" bias = clamp(bias, 0,0.01);\n"
|
||||
" float visibility = texture(shadowMap, vec3(ShadowCoord.xy,(ShadowCoord.z-bias)/ShadowCoord.w));\n"
|
||||
" \n"
|
||||
" float visibility = texture(shadowMap, vec3(ShadowCoord.xy,(ShadowCoord.z)/ShadowCoord.w));\n"
|
||||
" \n"
|
||||
" intensity = 0.7*intensity + 0.3*intensity*visibility;\n"
|
||||
" \n"
|
||||
|
||||
Reference in New Issue
Block a user