-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multiple shadow mapping improvements (#100). See description
Changes: - Added HlmsMacroblock::mDepthClamp - Added RSC_DEPTH_CLAMP, present almost anywhere except A7, A8 iOS HW - Added shadow map pancacking using mDepthClamp to FocusedShadowCameraSetup for directional shadow maps. This tightens depth range, increasing precision and decreasing the need for 32-bit depth buffers - Fix normal offset bias heavily dependent on shadow map resolution - Point lights' normal offset bias was accidentally hardcoded - shadowConstantBias in the caster shader no longer varies implicitly due to depth range. It was a cryptic (user hostile) way of increasing bias to higher splits. - Changed default value of constantBiasScale - Changed default value of normalOffsetBias - Added autoConstantBiasScale and autoNormalOffsetBiasScale. This value adjusts the bias based on the size of the shadow camera. Shadow cameras covering more area require bigger biases. This setting is a much user-friendlier way of automatically scaling the bias to higher splits.
- Loading branch information
1 parent
50d84a8
commit 652acb3
Showing
16 changed files
with
123 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -399,6 +399,12 @@ namespace Ogre { | |
rsc->setCapability(RSC_TYPED_UAV_LOADS); | ||
} | ||
|
||
if( mHasGL43 || mGLSupport->checkExtension( "GL_ARB_depth_clamp" ) || | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
darksylinc
Author
Member
|
||
mGLSupport->checkExtension( "GL_NV_depth_clamp" ) ) | ||
{ | ||
rsc->setCapability( RSC_DEPTH_CLAMP ); | ||
} | ||
|
||
if( mGLSupport->checkExtension( "GL_ARB_shader_viewport_layer_array" ) ) | ||
rsc->setCapability( RSC_VP_AND_RT_ARRAY_INDEX_FROM_ANY_SHADER ); | ||
|
||
|
@@ -2054,6 +2060,14 @@ namespace Ogre { | |
|
||
_setDepthBias( macroblock->mDepthBiasConstant, macroblock->mDepthBiasSlopeScale ); | ||
|
||
if( macroblock->mDepthClamp ) | ||
{ | ||
OCGE( glEnable( GL_DEPTH_CLAMP ) ); | ||
} | ||
else | ||
{ | ||
OCGE( glDisable( GL_DEPTH_CLAMP ) ); | ||
} | ||
|
||
//Cull mode | ||
if( pso->cullMode == 0 ) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I think this is in 3.0 core