浏览代码

Get rendertargets working with VR

/vr_fptl_sandbox
Robert Srinivasiah 8 年前
当前提交
a269a18b
共有 1 个文件被更改,包括 30 次插入9 次删除
  1. 39
      Assets/ScriptableRenderPipeline/fptl/FptlLighting.cs

39
Assets/ScriptableRenderPipeline/fptl/FptlLighting.cs


//cmd.GetTemporaryRT(s_CameraTarget, width, height, 0, FilterMode.Point, formatHDR, RenderTextureReadWrite.Default, 1, true); // rtv/uav
// finish this...
RenderTextureDesc modDesc = baseDesc;
modDesc.depthBufferBits = 0;
modDesc.colorFormat = RenderTextureFormat.ARGB32;
modDesc.flags &= RenderTextureCreationFlags.SRGB; // fix this...turn off the SRGB flag
cmd.GetTemporaryRT()
var colorMRTs = new RenderTargetIdentifier[4] { s_GBufferAlbedo, s_GBufferSpecRough, s_GBufferNormal, s_GBufferEmission };
RenderTextureDesc modDesc = baseDesc;
// VR - do i need to set the AA value?
modDesc.depthBufferBits = 0;
modDesc.colorFormat = RenderTextureFormat.ARGB32;
modDesc.flags &= ~(RenderTextureCreationFlags.EnableRandomWrite);
modDesc.flags |= RenderTextureCreationFlags.SRGB;
cmd.GetTemporaryRT(s_GBufferAlbedo, modDesc, FilterMode.Point);
cmd.GetTemporaryRT(s_GBufferSpecRough, modDesc, FilterMode.Point);
modDesc.colorFormat = format10;
modDesc.flags &= ~(RenderTextureCreationFlags.SRGB);
cmd.GetTemporaryRT(s_GBufferNormal, modDesc, FilterMode.Point);
modDesc.colorFormat = formatHDR;
cmd.GetTemporaryRT(s_GBufferEmission, modDesc, FilterMode.Point);
modDesc.colorFormat = RenderTextureFormat.Depth;
modDesc.depthBufferBits = 24;
cmd.GetTemporaryRT(s_GBufferZ, modDesc, FilterMode.Point);
cmd.GetTemporaryRT(s_CameraDepthTexture, modDesc, FilterMode.Point);
modDesc.colorFormat = formatHDR;
modDesc.depthBufferBits = 0;
modDesc.flags |= RenderTextureCreationFlags.SRGB;
modDesc.flags |= RenderTextureCreationFlags.EnableRandomWrite;
cmd.GetTemporaryRT(s_CameraTarget, modDesc, FilterMode.Point);
var colorMRTs = new RenderTargetIdentifier[4] { s_GBufferAlbedo, s_GBufferSpecRough, s_GBufferNormal, s_GBufferEmission };
cmd.SetRenderTarget(colorMRTs, new RenderTargetIdentifier(s_GBufferZ));
cmd.ClearRenderTarget(true, true, new Color(0, 0, 0, 0));

正在加载...
取消
保存