|
|
|
|
|
|
public enum StencilBitMask |
|
|
|
{ |
|
|
|
Clear = 0, // 0x0
|
|
|
|
Lighting = 7, // 0x7 - 3 bit
|
|
|
|
LightingMask = 7, // 0x7 - 3 bit
|
|
|
|
ObjectVelocity = 128, // 1 bit
|
|
|
|
All = 255 // 0xFF - 8 bit
|
|
|
|
} |
|
|
|
|
|
|
// General material
|
|
|
|
m_CopyStencilForNoLighting = CoreUtils.CreateEngineMaterial(asset.renderPipelineResources.copyStencilBuffer); |
|
|
|
m_CopyStencilForNoLighting.SetInt(HDShaderIDs._StencilRef, (int)StencilLightingUsage.NoLighting); |
|
|
|
m_CopyStencilForNoLighting.SetInt(HDShaderIDs._StencilMask, (int)StencilBitMask.LightingMask); |
|
|
|
m_CameraMotionVectorsMaterial = CoreUtils.CreateEngineMaterial(asset.renderPipelineResources.cameraMotionVectors); |
|
|
|
|
|
|
|
InitializeDebugMaterials(); |
|
|
|
|
|
|
// In the material classification shader we will simply test is we are no lighting
|
|
|
|
// Use ShaderPassID 1 => "Pass 1 - Write 1 if value different from stencilRef to output"
|
|
|
|
CoreUtils.DrawFullScreen(cmd, m_CopyStencilForNoLighting, m_CameraStencilBufferCopyRT, m_CameraDepthStencilBufferRT, null, 1); |
|
|
|
cmd.ClearRandomWriteTargets(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|