浏览代码

Keep stereo Guassian pyramids square (for now)

Stereo double-wide will need a double-width Gaussian pyramid texture (both eyes in one texture), but we don't need to do that now.

I did fix a bug I made in the _Size constant generation for RenderGaussianPyramidColor.  It only affects double-wide, but it was worth fixing.
/feature-ReflectionProbeFit
Robert Srinivasiah 7 年前
当前提交
7b4b8233
共有 1 个文件被更改,包括 7 次插入5 次删除
  1. 12
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs

12
ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs


cmd.GetTemporaryRT(HDShaderIDs._GaussianPyramidColorMips[i + 1], colorPyramidDesc, FilterMode.Bilinear);
cmd.SetComputeTextureParam(m_GaussianPyramidCS, m_GaussianPyramidKernel, "_Source", last);
cmd.SetComputeTextureParam(m_GaussianPyramidCS, m_GaussianPyramidKernel, "_Result", HDShaderIDs._GaussianPyramidColorMips[i + 1]);
cmd.SetComputeVectorParam(m_GaussianPyramidCS, "_Size", new Vector4(colorPyramidDesc.height, colorPyramidDesc.height, 1f / colorPyramidDesc.height, 1f / colorPyramidDesc.height));
cmd.SetComputeVectorParam(m_GaussianPyramidCS, "_Size", new Vector4(colorPyramidDesc.width, colorPyramidDesc.height, 1f / colorPyramidDesc.width, 1f / colorPyramidDesc.height));
cmd.DispatchCompute(m_GaussianPyramidCS, m_GaussianPyramidKernel, colorPyramidDesc.width / 8, colorPyramidDesc.height / 8, 1);
cmd.CopyTexture(HDShaderIDs._GaussianPyramidColorMips[i + 1], 0, 0, m_GaussianPyramidColorBufferRT, 0, i + 1);

var pyramidSize = CalculatePyramidSize((int)hdCamera.screenSize.x, (int)hdCamera.screenSize.y);
var widthModifier = 1;
if (stereoEnabled && (desc.dimension != TextureDimension.Tex2DArray))
widthModifier = 2; // double-wide
// for stereo double-wide, each half of the texture will represent a single eye's pyramid
//var widthModifier = 1;
//if (stereoEnabled && (desc.dimension != TextureDimension.Tex2DArray))
// widthModifier = 2; // double-wide
desc.width = pyramidSize * widthModifier;
//desc.width = pyramidSize * widthModifier;
desc.width = pyramidSize;
desc.height = pyramidSize;
return desc;

正在加载...
取消
保存