瀏覽代碼

Merge pull request #493 from Azaezel/alpha40/shadowVarValidators

shadowmap validator tweaks
Brian Roberts 4 年之前
父節點
當前提交
b02bead6ea
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. 4 3
      Engine/source/lighting/shadowMap/lightShadowMap.cpp

+ 4 - 3
Engine/source/lighting/shadowMap/lightShadowMap.cpp

@@ -585,7 +585,7 @@ void ShadowMapParams::_validate()
    // We apply the hardware specific limits during 
    // We apply the hardware specific limits during 
    // shadow rendering.
    // shadow rendering.
    //
    //
-   U32 maxTexSize = 4096;
+   U32 maxTexSize = 8192;
 
 
    if ( mLight->getType() == LightInfo::Vector )
    if ( mLight->getType() == LightInfo::Vector )
    {
    {
@@ -595,15 +595,16 @@ void ShadowMapParams::_validate()
       // based on the split count to keep the total
       // based on the split count to keep the total
       // shadow texture size within 4096.
       // shadow texture size within 4096.
       if ( numSplits == 2 || numSplits == 4 )
       if ( numSplits == 2 || numSplits == 4 )
-         maxTexSize = 4096;
+         maxTexSize = 8192;
       if ( numSplits == 3 )
       if ( numSplits == 3 )
-         maxTexSize = 2048;
+         maxTexSize = 4096;
    }
    }
    else
    else
       numSplits = 1;
       numSplits = 1;
 
 
    // Keep it in a valid range... less than 32 is dumb.
    // Keep it in a valid range... less than 32 is dumb.
    texSize = mClamp( texSize, 32, maxTexSize );
    texSize = mClamp( texSize, 32, maxTexSize );
+   shadowDistance = mClamp(shadowDistance, 25.0f, 10000.0f);
 }
 }
 
 
 LightShadowMap* ShadowMapParams::getOrCreateShadowMap()
 LightShadowMap* ShadowMapParams::getOrCreateShadowMap()