浏览代码

Fix CSM for camera-relative rendering and enable the latter by default

/RenderPassXR_Sandbox
Evgenii Golubev 7 年前
当前提交
72d87a7d
共有 3 个文件被更改,包括 8 次插入2 次删除
  1. 6
      Assets/ScriptableRenderPipeline/Core/Shadow/Shadow.cs
  2. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/ShaderConfig.cs
  3. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/ShaderConfig.cs.hlsl

6
Assets/ScriptableRenderPipeline/Core/Shadow/Shadow.cs


Matrix4x4 translation = Matrix4x4.Translate(camPosWS);
ce.current.view *= translation;
vp *= translation;
if (sr.shadowType == GPUShadowType.Directional)
{
m_TmpSplits[key.faceIdx].x -= camPosWS.x;
m_TmpSplits[key.faceIdx].y -= camPosWS.y;
m_TmpSplits[key.faceIdx].z -= camPosWS.z;
}
}
// write :(
ce.current.shadowAlgo = shadowAlgo;

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/ShaderConfig.cs


VelocityInGBuffer = 0, // Change to 1 to enable the feature, then regenerate hlsl headers.
// TODO: not working yet, waiting for UINT16 RT format support
PackGBufferInU16 = 0,
CameraRelativeRendering = 0 // Rendering sets the origin of the world to the position of the primary (scene view) camera
CameraRelativeRendering = 1 // Rendering sets the origin of the world to the position of the primary (scene view) camera
};
// Note: #define can't be use in include file in C# so we chose this way to configure both C# and hlsl

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/ShaderConfig.cs.hlsl


//
#define SHADEROPTIONS_VELOCITY_IN_GBUFFER (0)
#define SHADEROPTIONS_PACK_GBUFFER_IN_U16 (0)
#define SHADEROPTIONS_CAMERA_RELATIVE_RENDERING (0)
#define SHADEROPTIONS_CAMERA_RELATIVE_RENDERING (1)
#endif
正在加载...
取消
保存