|
|
|
|
|
|
cmd.SetComputeTextureParam(m_SubsurfaceScatteringCS, m_SubsurfaceScatteringKernel, HDShaderIDs._CameraFilteringBuffer, m_CameraFilteringBuffer); |
|
|
|
|
|
|
|
// Perform the SSS filtering pass which fills 'm_CameraFilteringBufferRT'.
|
|
|
|
// We dispatch 4x swizzled 16x16 groups per a 32x32 macro tile.
|
|
|
|
cmd.DispatchCompute(m_SubsurfaceScatteringCS, m_SubsurfaceScatteringKernel, 4, ((int)hdCamera.screenSize.x + 31) / 32, ((int)hdCamera.screenSize.y + 31) / 32); |
|
|
|
cmd.DispatchCompute(m_SubsurfaceScatteringCS, m_SubsurfaceScatteringKernel, ((int)hdCamera.screenSize.x + 15) / 16, ((int)hdCamera.screenSize.y + 15) / 16, 1); |
|
|
|
|
|
|
|
cmd.SetGlobalTexture(HDShaderIDs._IrradianceSource, m_CameraFilteringBuffer); // Cannot set a RT on a material
|
|
|
|
|
|
|
|
|
|
|
cmd.SetComputeTextureParam(m_SubsurfaceScatteringCS, m_SubsurfaceScatteringKernel, HDShaderIDs._CameraColorTexture, colorBufferRT); |
|
|
|
|
|
|
|
// Perform the SSS filtering pass which performs an in-place update of 'colorBuffer'.
|
|
|
|
// We dispatch 4x swizzled 16x16 groups per a 32x32 macro tile.
|
|
|
|
cmd.DispatchCompute(m_SubsurfaceScatteringCS, m_SubsurfaceScatteringKernel, 4, ((int)hdCamera.screenSize.x + 31) / 32, ((int)hdCamera.screenSize.y + 31) / 32); |
|
|
|
cmd.DispatchCompute(m_SubsurfaceScatteringCS, m_SubsurfaceScatteringKernel, ((int)hdCamera.screenSize.x + 15) / 16, ((int)hdCamera.screenSize.y + 15) / 16, 1); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|