浏览代码

Don't take TerrainLayer.smoothness and TerrainLayer.metallic into surface attributes if mask map textures are used.

/main
Yao Xiao Ling 6 年前
当前提交
ef786cd0
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. 6
      com.unity.render-pipelines.high-definition/HDRP/Material/TerrainLit/TerrainLitSplatCommon.hlsl

6
com.unity.render-pipelines.high-definition/HDRP/Material/TerrainLit/TerrainLitSplatCommon.hlsl


#endif
}
float4 RemapMasks(float4 masks, float blendMask, float metallic, float smoothness, float4 remapOffset, float4 remapScale)
float4 RemapMasks(float4 masks, float blendMask, float4 remapOffset, float4 remapScale)
ret.r *= metallic;
ret.a *= smoothness;
ret = ret * remapScale + remapOffset;
return ret;
}

#endif
#ifdef _MASKMAP
#define SampleMasks(i, blendMask) RemapMasks(SAMPLE_TEXTURE2D_GRAD(_Mask##i, sampler_Splat0, splatuv, splatdxuv, splatdyuv), blendMask, _Metallic##i, _Smoothness##i, _MaskMapRemapOffset##i, _MaskMapRemapScale##i)
#define SampleMasks(i, blendMask) RemapMasks(SAMPLE_TEXTURE2D_GRAD(_Mask##i, sampler_Splat0, splatuv, splatdxuv, splatdyuv), blendMask, _MaskMapRemapOffset##i, _MaskMapRemapScale##i)
#define NullMask(i) float4(0, 1, _MaskMapRemapOffset##i.z, 0) // only height matters when weight is zero.
#else
#define SampleMasks(i, blendMask) float4(_Metallic##i, 1, 0, albedo[i].a * _Smoothness##i)

正在加载...
取消
保存