vault backup: 2024-12-19 15:13:04
This commit is contained in:
parent
3400c5f518
commit
6a24cc4470
@ -1 +1 @@
|
||||
{"SequoiaCamShotEvalTemplate":{"SequoiaCamShotEvalTemplate":{"currentFile":{"count":1,"lastUpdated":1732609264076}}},"c++内存泄漏分析工具":{"c++内存泄漏分析工具":{"internalLink":{"count":1,"lastUpdated":1733137754779}}},"Lights":{"Lights":{"currentFile":{"count":1,"lastUpdated":1733637911876}}},"FShadowProjectionNoTransformVS(ShadowProjectionNoTransformVS)、FShadowVolumeBoundProjectionVS(ShadowVolumeBoundProjectionVS)":{"FShadowProjectionNoTransformVS(ShadowProjectionNoTransformVS)、FShadowVolumeBoundProjectionVS(ShadowVolumeBoundProjectionVS)":{"currentFile":{"count":1,"lastUpdated":1734345863513}}},"DecodeLightAttenuation":{"DecodeLightAttenuation":{"currentFile":{"count":1,"lastUpdated":1734406452310}}}}
|
||||
{"SequoiaCamShotEvalTemplate":{"SequoiaCamShotEvalTemplate":{"currentFile":{"count":1,"lastUpdated":1732609264076}}},"c++内存泄漏分析工具":{"c++内存泄漏分析工具":{"internalLink":{"count":1,"lastUpdated":1733137754779}}},"Lights":{"Lights":{"currentFile":{"count":1,"lastUpdated":1733637911876}}},"FShadowProjectionNoTransformVS(ShadowProjectionNoTransformVS)、FShadowVolumeBoundProjectionVS(ShadowVolumeBoundProjectionVS)":{"FShadowProjectionNoTransformVS(ShadowProjectionNoTransformVS)、FShadowVolumeBoundProjectionVS(ShadowVolumeBoundProjectionVS)":{"currentFile":{"count":1,"lastUpdated":1734345863513}}},"DecodeLightAttenuation":{"DecodeLightAttenuation":{"currentFile":{"count":1,"lastUpdated":1734406452310}}},"clamped":{"clamped":{"currentFile":{"count":1,"lastUpdated":1734590559877}}}}
|
@ -436,6 +436,29 @@ bool FShadowDepthPassMeshProcessor::TryAddMeshBatch(const FMeshBatch& RESTRICT M
|
||||
}
|
||||
```
|
||||
|
||||
## ShaderDepthBias
|
||||
相关计算位于FProjectedShadowInfo::UpdateShaderDepthBias()。
|
||||
起效条件:勾选Dynamic Inset Shadow
|
||||
CMD: CVarPerObjectDirectionalShadowDepthBias => r.Shadow.PerObjectDirectionalDepthBias
|
||||
```c++
|
||||
// per object shadows (the whole-scene are taken care of above)
|
||||
if(bDirectionalLight)
|
||||
{
|
||||
// we use CSMShadowDepthBias cvar but this is per object shadows, maybe we want to use different settings
|
||||
|
||||
// the z range is adjusted to we need to adjust here as well
|
||||
DepthBias = CVarPerObjectDirectionalShadowDepthBias.GetValueOnRenderThread() / (MaxSubjectZ - MinSubjectZ);
|
||||
|
||||
float WorldSpaceTexelScale = ShadowBounds.W / FMath::Max(ResolutionX, ResolutionY);
|
||||
|
||||
DepthBias *= WorldSpaceTexelScale;
|
||||
DepthBias *= 0.5f; // avg GetUserShadowBias, in that case we don't want this adjustable
|
||||
|
||||
SlopeScaleDepthBias = CVarPerObjectDirectionalShadowSlopeScaleDepthBias.GetValueOnRenderThread();
|
||||
SlopeScaleDepthBias *= LightSceneInfo->Proxy->GetUserShadowSlopeBias();
|
||||
}
|
||||
```
|
||||
|
||||
## Shader
|
||||
VertexShader为:ShadowDepthVertexShader.usf,有4种变体:
|
||||
- IMPLEMENT_SHADOW_DEPTH_SHADERMODE_SHADERS(VertexShadowDepth_PerspectiveCorrect);
|
||||
|
Loading…
x
Reference in New Issue
Block a user