浏览代码

Load instead of sample dbuffer normal texture

/main
Paul Melamed 6 年前
当前提交
9bac77ab
共有 1 个文件被更改,包括 3 次插入5 次删除
  1. 8
      com.unity.render-pipelines.high-definition/HDRP/Material/Decal/DecalNormalBuffer.shader

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


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

{
Varyings output;
output.positionCS = GetFullScreenTriangleVertexPosition(input.vertexID);
output.texcoord = GetFullScreenTriangleTexCoord(input.vertexID);// *_BlitScaleBias.xy + _BlitScaleBias.zw;
output.texcoord = GetFullScreenTriangleTexCoord(input.vertexID);
float4 DBufferNormal = SAMPLE_TEXTURE2D(_DBufferTexture1, sampler_PointClamp, input.texcoord) * 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);

正在加载...
取消
保存