Increasing maxShadowSampleCount to 26.

This commit is contained in:
Faerbit 2015-06-02 21:14:22 +02:00
parent a6876f0872
commit b8114ebd91
2 changed files with 46 additions and 2 deletions

View File

@ -32,6 +32,17 @@ uniform samplerCubeShadow shadowMap_cube11;
uniform samplerCubeShadow shadowMap_cube12;
uniform samplerCubeShadow shadowMap_cube13;
uniform samplerCubeShadow shadowMap_cube14;
uniform samplerCubeShadow shadowMap_cube15;
uniform samplerCubeShadow shadowMap_cube16;
uniform samplerCubeShadow shadowMap_cube17;
uniform samplerCubeShadow shadowMap_cube18;
uniform samplerCubeShadow shadowMap_cube19;
uniform samplerCubeShadow shadowMap_cube20;
uniform samplerCubeShadow shadowMap_cube21;
uniform samplerCubeShadow shadowMap_cube22;
uniform samplerCubeShadow shadowMap_cube23;
uniform samplerCubeShadow shadowMap_cube24;
uniform samplerCubeShadow shadowMap_cube25;
uniform vec3 ambientColor;
uniform float ambientFactor;
uniform float diffuseFactor;
@ -334,6 +345,39 @@ void main()
if (i == 14 && i<maxShadowRenderCount) {
pointVisibility = samplePointShadow(shadowMap_cube14, lightDirection, intensity);
}
if (i == 15 && i<maxShadowRenderCount) {
pointVisibility = samplePointShadow(shadowMap_cube15, lightDirection, intensity);
}
if (i == 16 && i<maxShadowRenderCount) {
pointVisibility = samplePointShadow(shadowMap_cube16, lightDirection, intensity);
}
if (i == 17 && i<maxShadowRenderCount) {
pointVisibility = samplePointShadow(shadowMap_cube17, lightDirection, intensity);
}
if (i == 18 && i<maxShadowRenderCount) {
pointVisibility = samplePointShadow(shadowMap_cube18, lightDirection, intensity);
}
if (i == 19 && i<maxShadowRenderCount) {
pointVisibility = samplePointShadow(shadowMap_cube19, lightDirection, intensity);
}
if (i == 20 && i<maxShadowRenderCount) {
pointVisibility = samplePointShadow(shadowMap_cube20, lightDirection, intensity);
}
if (i == 21 && i<maxShadowRenderCount) {
pointVisibility = samplePointShadow(shadowMap_cube21, lightDirection, intensity);
}
if (i == 22 && i<maxShadowRenderCount) {
pointVisibility = samplePointShadow(shadowMap_cube22, lightDirection, intensity);
}
if (i == 23 && i<maxShadowRenderCount) {
pointVisibility = samplePointShadow(shadowMap_cube23, lightDirection, intensity);
}
if (i == 24 && i<maxShadowRenderCount) {
pointVisibility = samplePointShadow(shadowMap_cube24, lightDirection, intensity);
}
if (i == 25 && i<maxShadowRenderCount) {
pointVisibility = samplePointShadow(shadowMap_cube25, lightDirection, intensity);
}
vec3 lightVector = normalize(lightPos-vec3(fragPosition));
diffuseColor += clamp(dot(normalize(vNormal), lightVector)
*diffuseFactor*intensity*lightColors[i]*pointVisibility, 0.0, 1.0);

View File

@ -12,7 +12,7 @@ using namespace ACGL::OpenGL;
const double lightUpdateDelay = 0.5f;
const double windUpdateDelay = 0.5f;
const int maxShadowSampleCount = 15;
const int maxShadowSampleCount = 26;
Graphics::Graphics(glm::uvec2 windowSize, float nearPlane,
float farPlane, int cube_size,
@ -33,7 +33,7 @@ Graphics::Graphics(glm::uvec2 windowSize, float nearPlane,
else {
this->cube_size = 0;
}
if (maxShadowRenderCount < 15) {
if (maxShadowRenderCount < maxShadowSampleCount) {
this->maxShadowRenderCount = maxShadowRenderCount;
}
else {