浏览代码

Added camera HDR setup

/main
Felipe Lira 7 年前
当前提交
4dcb7214
共有 2 个文件被更改,包括 5 次插入3 次删除
  1. 3
      ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightForwardRenderer.cs
  2. 5
      ScriptableRenderPipeline/LightweightPipeline/LWRP/Passes/ForwardLitPass.cs

3
ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightForwardRenderer.cs


desc = new RenderTextureDescriptor(camera.pixelWidth, camera.pixelHeight);
float renderScale = cameraData.renderScale;
desc.colorFormat = cameraData.isHdrEnabled ? RenderTextureFormat.DefaultHDR :
RenderTextureFormat.Default;
desc.enableRandomWrite = false;
desc.width = (int)((float)desc.width * renderScale * scaler);
desc.height = (int)((float)desc.height * renderScale * scaler);
return desc;

5
ScriptableRenderPipeline/LightweightPipeline/LWRP/Passes/ForwardLitPass.cs


m_LightSpotDirections = new Vector4[maxVisibleLocalLights];
m_LightSpotAttenuations = new Vector4[maxVisibleLocalLights];
// TODO: HDR
m_ColorFormat = RenderTextureFormat.Default;
m_BlitMaterial = renderer.GetMaterial(MaterialHandles.Blit);
m_ErrorMaterial = renderer.GetMaterial(MaterialHandles.Error);

public override void Setup(CommandBuffer cmd, RenderTextureDescriptor baseDescriptor, int[] colorAttachmentHandles, int depthAttachmentHandle = -1, int samples = 1)
{
base.Setup(cmd, baseDescriptor, colorAttachmentHandles, depthAttachmentHandle, samples);
m_ColorFormat = baseDescriptor.colorFormat;
descriptor.colorFormat = m_ColorFormat;
descriptor.enableRandomWrite = false;
cmd.GetTemporaryRT(colorAttachmentHandle, descriptor, FilterMode.Bilinear);
}

正在加载...
取消
保存