|
|
|
|
|
|
m_gbufferManager.SetBufferDescription(gbufferIndex, "_GBufferTexture" + gbufferIndex, RTFormat[gbufferIndex], RTReadWrite[gbufferIndex]); |
|
|
|
} |
|
|
|
|
|
|
|
#pragma warning disable 162 // warning CS0162: Unreachable code detected
|
|
|
|
if (ShaderConfig.VelocityInGbuffer == 1) |
|
|
|
if (ShaderConfig.s_VelocityInGbuffer == 1) |
|
|
|
{ |
|
|
|
// If velocity is in GBuffer then it is in the last RT. Assign a different name to it.
|
|
|
|
m_gbufferManager.SetBufferDescription(m_gbufferManager.gbufferCount, "_VelocityTexture", Builtin.RenderLoop.GetVelocityBufferFormat(), Builtin.RenderLoop.GetVelocityBufferReadWrite()); |
|
|
|
|
|
|
#pragma warning restore 162
|
|
|
|
|
|
|
|
m_DistortionBuffer = Shader.PropertyToID("_DistortionTexture"); |
|
|
|
m_DistortionBufferRT = new RenderTargetIdentifier(m_DistortionBuffer); |
|
|
|
|
|
|
{ |
|
|
|
using (new Utilities.ProfilingSample("Velocity Pass", renderLoop)) |
|
|
|
{ |
|
|
|
// warning CS0162: Unreachable code detected // warning CS0429: Unreachable expression code detected
|
|
|
|
#pragma warning disable 162, 429
|
|
|
|
if ((ShaderConfig.VelocityInGbuffer == 0) || debugParameters.useForwardRenderingOnly) |
|
|
|
if ((ShaderConfig.s_VelocityInGbuffer == 0) || debugParameters.useForwardRenderingOnly) |
|
|
|
return ; |
|
|
|
|
|
|
|
int w = camera.pixelWidth; |
|
|
|
|
|
|
cmd.Dispose(); |
|
|
|
|
|
|
|
RenderOpaqueRenderList(cullResults, camera, renderLoop, "MotionVectors"); |
|
|
|
#pragma warning restore 162, 429
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|