您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

22 行
781 B

#ifndef __LOADNORMALBUFFER_H__
#define __LOADNORMALBUFFER_H__
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/TextureXR.hlsl"
#ifndef UNITY_COMMON_MATERIAL_INCLUDED// in 7.3.1 there is no include guard in NormalBuffer.hlsl
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/NormalBuffer.hlsl"
#endif
void LoadNormalBuffer_float(in float2 positionSS, out float3 normalWS, out float smoothness)
{
#if defined(SHADERPASS) && (SHADERPASS == SHADERPASS_FORWARD)
NormalData normalData;
DecodeFromNormalBuffer(positionSS.xy, normalData);
normalWS = normalData.normalWS;
smoothness = 1.0 - normalData.perceptualRoughness;
#else
normalWS = float3(0, 0, 1);
smoothness = 0.5;
#endif
}
#endif//__LOADNORMALBUFFER_H__