浏览代码

Add RenderTexture helper methods to HDRenderPipeline

/feature-ReflectionProbeFit
Robert Srinivasiah 7 年前
当前提交
8fea3b39
共有 2 个文件被更改,包括 28 次插入0 次删除
  1. 1
      ScriptableRenderPipeline/HDRenderPipeline/Camera/HDCamera.cs
  2. 27
      ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs

1
ScriptableRenderPipeline/HDRenderPipeline/Camera/HDCamera.cs


tempDesc.depthBufferBits = 0;
tempDesc.autoGenerateMips = false;
tempDesc.useMipMap = false;
tempDesc.enableRandomWrite = false;
tempDesc.memoryless = RenderTextureMemoryless.None;
renderTextureDesc = tempDesc;

27
ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs


};
#endif
RenderTexture CreateRenderTexture(HDCamera hdCamera, int depthBufferBits, RenderTextureFormat format, RenderTextureReadWrite readWrite = RenderTextureReadWrite.Default)
{
var localDesc = hdCamera.renderTextureDesc;
localDesc.depthBufferBits = depthBufferBits;
localDesc.colorFormat = format;
localDesc.sRGB = (readWrite != RenderTextureReadWrite.Linear);
// TODO: Explicit MSAA support will come in later
return new RenderTexture(localDesc);
}
void CreateTemporaryRT(CommandBuffer cmd, int nameID, HDCamera hdCamera,
int depthBufferBits, FilterMode filter, RenderTextureFormat format,
RenderTextureReadWrite readWrite = RenderTextureReadWrite.Default, int msaaSamples = 1, bool enableRandomWrite = false)
{
var localDesc = hdCamera.renderTextureDesc;
localDesc.depthBufferBits = depthBufferBits;
localDesc.colorFormat = format;
localDesc.sRGB = (readWrite != RenderTextureReadWrite.Linear);
localDesc.msaaSamples = msaaSamples;
localDesc.enableRandomWrite = enableRandomWrite;
cmd.GetTemporaryRT(nameID, localDesc, filter);
}
void CreateDepthStencilBuffer(Camera camera)
{
if (m_CameraDepthStencilBuffer != null)

正在加载...
取消
保存