浏览代码

cleanup

/main
Paul Melamed 6 年前
当前提交
009933ca
共有 2 个文件被更改,包括 7 次插入4 次删除
  1. 9
      com.unity.render-pipelines.high-definition/HDRP/Material/Decal/DecalNormalBuffer.shader
  2. 2
      com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/HDRenderPipeline.cs

9
com.unity.render-pipelines.high-definition/HDRP/Material/Decal/DecalNormalBuffer.shader


TEXTURE2D(_DBufferTexture1);
RW_TEXTURE2D(float4, _NormalBuffer);
struct Attributes
{
uint vertexID : SV_VertexID;

float4 FragNearest(Varyings input) : SV_Target
{
float4 DBufferNormal = LOAD_TEXTURE2D(_DBufferTexture1, input.texcoord * _ScreenSize.xy) * float4(2.0f, 2.0f, 2.0f, 1.0f) - float4(1.0f, 1.0f, 1.0f, 0.0f);
float4 DBufferNormal = LOAD_TEXTURE2D(_DBufferTexture1, input.texcoord * _ScreenSize.xy) * float4(2.0f, 2.0f, 2.0f, 1.0f) - float4(1.0f, 1.0f, 1.0f, 0.0f);
float4 GBufferNormal = _NormalBuffer[input.texcoord * _ScreenSize.xy];
NormalData normalData;
DecodeFromNormalBuffer(GBufferNormal, uint2(0, 0), normalData);

ZTest Always
Blend Off
Cull Off
// depth prepass increments stencil to 1
// dbuffer increments it to 2
// not optimal because we also process pixels that might not have any normals
Stencil
{
WriteMask 255

2
com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/HDRenderPipeline.cs


// We can now bind the normal buffer to be use by any effect
m_NormalBufferManager.BindNormalBuffers(cmd);
if (hdCamera.frameSettings.enableForwardRenderingOnly)
if ((hdCamera.frameSettings.enableForwardRenderingOnly) && (!hdCamera.frameSettings.enableMSAA)) // MSAA not supported
{
using (new ProfilingSample(cmd, "DBuffer Normal (forward)", CustomSamplerId.DBufferNormal.GetSampler()))
{

正在加载...
取消
保存