浏览代码

Added copy utility

/stochastic_alpha_test
Frédéric Vauchelles 7 年前
当前提交
690a1a14
共有 4 个文件被更改,包括 16 次插入5 次删除
  1. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
  2. 6
      ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipelineAsset.asset
  3. 11
      ScriptableRenderPipeline/HDRenderPipeline/HDUtils.cs
  4. 2
      ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/HDRenderPipelineResources.asset.meta

2
ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs


cmd.SetGlobalVector(HDShaderIDs._DepthPyramidMipSize, new Vector4(size, size, lodCount, 0));
cmd.GetTemporaryRT(HDShaderIDs._DepthPyramidMips[0], size, size, 0, FilterMode.Bilinear, RenderTextureFormat.RFloat, RenderTextureReadWrite.Linear, 1, true);
Utilities.SampleCopyChannel_xyzw2x(cmd, GetDepthTexture(), HDShaderIDs._DepthPyramidMips[0], new Vector2(size, size), m_Asset.renderPipelineResources);
HDUtils.SampleCopyChannel_xyzw2x(cmd, GetDepthTexture(), HDShaderIDs._DepthPyramidMips[0], new Vector2(size, size), m_Asset.renderPipelineResources);
cmd.CopyTexture(HDShaderIDs._DepthPyramidMips[0], 0, 0, m_DepthPyramidBuffer, 0, 0);
for (int i = 0; i < lodCount; i++)

6
ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipelineAsset.asset


profiles:
- {fileID: 11400000, guid: 906339bac2066fc4aa22a3652e1283ef, type: 2}
- {fileID: 11400000, guid: d6ee4403015766f4093158d69216c0bf, type: 2}
texturingModeFlags: 1
transmissionFlags: 5460
texturingModeFlags: 0
transmissionFlags: 5462
- {x: 0, y: 12.031147, z: 0, w: 0}
- {x: 0, y: 8.152544, z: 0, w: 0}
- {x: 0, y: 0.2873168, z: 0, w: 0}
- {x: 0, y: 5, z: 0, w: 0}
- {x: 0, y: 12.031147, z: 0, w: 0}

11
ScriptableRenderPipeline/HDRenderPipeline/HDUtils.cs


#if UNITY_EDITOR
using System.IO;
using UnityEditor;
using UnityEngine.Rendering;
#endif
namespace UnityEngine.Experimental.Rendering.HDPipeline

y -= s_OverlayLineHeight;
s_OverlayLineHeight = -1.0f;
}
}
public static void SampleCopyChannel_xyzw2x(CommandBuffer cmd, RenderTargetIdentifier source, RenderTargetIdentifier target, Vector2 size, RenderPipelineResources resources)
{
var s = new Vector4(size.x, size.y, 1f / size.x, 1f / size.y);
cmd.SetComputeVectorParam(resources.copyChannelCS, HDShaderIDs._Size, s);
cmd.SetComputeTextureParam(resources.copyChannelCS, resources.copyChannelKernel_xyzw2x, HDShaderIDs._Source4, source);
cmd.SetComputeTextureParam(resources.copyChannelCS, resources.copyChannelKernel_xyzw2x, HDShaderIDs._Result1, target);
cmd.DispatchCompute(resources.copyChannelCS, resources.copyChannelKernel_xyzw2x, (int)(size.x) / 8, (int)(size.y) / 8, 1);
}
}
}

2
ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/HDRenderPipelineResources.asset.meta


fileFormatVersion: 2
guid: 42086e81f4f0c724f96f7f09cc995354
timeCreated: 1505146899
timeCreated: 1507102386
licenseType: Pro
NativeFormatImporter:
externalObjects: {}

正在加载...
取消
保存