public MyGBufferAndLightingPass() { m_GBufferDiffuse = new RenderPassAttachment(RenderTextureFormat.ARGB32); m_GBufferSpecularAndRoughness = new RenderPassAttachment(RenderTextureFormat.ARGB32); m_GBufferNormal = new RenderPassAttachment(RenderTextureFormat.ARGB2101010); m_CameraTarget = new RenderPassAttachment(RenderTextureFormat.ARGBHalf); m_Depth = new RenderPassAttachment(RenderTextureFormat.Depth); m_DeferredShadingMaterial = CoreUtils.CreateEngineMaterial(Shader.Find("Hidden/SIGGRAPH Studio/DeferredLighting")); m_CameraTarget.Clear(Color.black); m_Depth.Clear(Color.black); }
public DeferredRenderer() { // Create the attachment objects. If these attachments are not specifically bound to any RenderTexture using the BindSurface calls, // these are treated as temporary surfaces that are discarded at the end of the renderpass // NOTE: DO NOT ALLOCATE NEW RENDERPASSATTACHMENTS EVERY FRAME! // These objects only get garbage collected when a scene is unloaded, so you'll leak a lot of objects. m_Albedo = new RenderPassAttachment(RenderTextureFormat.ARGB32); m_SpecRough = new RenderPassAttachment(RenderTextureFormat.ARGB32); m_Normal = new RenderPassAttachment(RenderTextureFormat.ARGB2101010); m_Emission = new RenderPassAttachment(RenderTextureFormat.ARGBHalf); m_Depth = new RenderPassAttachment(RenderTextureFormat.Depth); // At the beginning of the render pass, clear the emission buffer to all black, and the depth buffer to 1.0f m_Emission.Clear(new Color(0.0f, 0.0f, 0.0f, 0.0f), 1.0f, 0); m_Depth.Clear(new Color(), 1.0f, 0); }
public SRPE01Instance(SRPE01 parent) { m_Parent = parent; //Attachments m_Albedo = new RenderPassAttachment(RenderTextureFormat.ARGB32); m_Emission = new RenderPassAttachment(RenderTextureFormat.ARGB32); m_Output = new RenderPassAttachment(RenderTextureFormat.ARGB32); m_Depth = new RenderPassAttachment(RenderTextureFormat.Depth); m_Albedo.Clear(Color.green, 1f, 0); m_Emission.Clear(Color.green, 1f, 0); //m_Output.Clear(Color.cyan); m_Depth.Clear(Color.black, 1f, 0); m_Output.BindSurface(BuiltinRenderTextureType.CameraTarget, false, true); }