浏览代码

Merge pull request #734 from Unity-Technologies/Minro-fix-after-merge-XR-PR

HDRenderPipeline: use width instead of height for depth and color pyramid for consistency
/feature-ReflectionProbeFit
GitHub 7 年前
当前提交
0ff42147
共有 3 个文件被更改,包括 7 次插入5 次删除
  1. 6
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs
  2. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/SubsurfaceScattering/SubsurfaceScattering.hlsl
  3. 4
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/SubsurfaceScattering/SubsurfaceScatteringManager.cs

6
ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs


using (new ProfilingSample(cmd, "Gaussian Pyramid Color", GetSampler(CustomSamplerId.GaussianPyramidColor)))
{
var colorPyramidDesc = m_GaussianPyramidColorBufferDesc;
var pyramidSideSize = colorPyramidDesc.height;
var pyramidSideSize = colorPyramidDesc.width;
// The gaussian pyramid compute works in blocks of 8x8 so make sure the last lod has a
// minimum size of 8x8

using (new ProfilingSample(cmd, "Pyramid Depth", GetSampler(CustomSamplerId.PyramidDepth)))
{
var depthPyramidDesc = m_DepthPyramidBufferDesc;
var pyramidSideSize = depthPyramidDesc.height;
var pyramidSideSize = depthPyramidDesc.width;
// The gaussian pyramid compute works in blocks of 8x8 so make sure the last lod has a
// minimum size of 8x8

var pyramidSize = CalculatePyramidSize((int)hdCamera.screenSize.x, (int)hdCamera.screenSize.y);
// for stereo double-wide, each half of the texture will represent a single eye's pyramid
// 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

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/SubsurfaceScattering/SubsurfaceScattering.hlsl


// SSSBuffer texture declaration
TEXTURE2D(_SSSBufferTexture0);
// Note: The SSS buffer used here is sRGB
// Note: The SSS buffer used here is sRGB
void DecodeFromSSSBuffer(float4 sssBuffer, uint2 positionSS, out SSSData sssData)
{
sssData.diffuseColor = sssBuffer.rgb;

4
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/SubsurfaceScattering/SubsurfaceScatteringManager.cs


// for SSS
public void InitSSSBuffersFromGBuffer(GBufferManager gbufferManager)
{
m_RTIDs[0] = gbufferManager.GetGBuffers()[0];
m_RTIDs[0] = gbufferManager.GetGBuffers()[0]; // Note: This buffer must be sRGB (which is the case with Lit.shader)
}
// In case of full forward we must allocate the render target for forward SSS (or reuse one already existing)

desc.depthBufferBits = 0;
desc.colorFormat = RenderTextureFormat.ARGB32;
desc.sRGB = false;
desc.sRGB = true; // Note: This buffer must be sRGB to match deferred case (which is the case with Lit.shader)
cmd.ReleaseTemporaryRT(m_SSSBuffer0);
cmd.GetTemporaryRT(m_SSSBuffer0, desc, FilterMode.Point);

正在加载...
取消
保存