您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
24 行
990 B
24 行
990 B
//-------------------------------------------------------------------------------------
|
|
// Fill SurfaceData/Builtin data function
|
|
//-------------------------------------------------------------------------------------
|
|
#include "ShaderLibrary/Packing.hlsl"
|
|
#include "ShaderLibrary/SampleUVMapping.hlsl"
|
|
|
|
void GetSurfaceData(float2 texCoordDS, out DecalSurfaceData surfaceData)
|
|
{
|
|
surfaceData.baseColor = float4(0,0,0,0);
|
|
surfaceData.normalWS = float4(0,0,0,0);
|
|
float totalBlend = _DecalBlend;
|
|
#if _COLORMAP
|
|
surfaceData.baseColor = SAMPLE_TEXTURE2D(_BaseColorMap, sampler_BaseColorMap, texCoordDS.xy);
|
|
totalBlend *= surfaceData.baseColor.w;
|
|
surfaceData.baseColor.w = totalBlend;
|
|
#endif
|
|
UVMapping texCoord;
|
|
ZERO_INITIALIZE(UVMapping, texCoord);
|
|
texCoord.uv = texCoordDS.xy;
|
|
#if _NORMALMAP
|
|
surfaceData.normalWS.xyz = mul((float3x3)_DecalToWorldR, SAMPLE_UVMAPPING_NORMALMAP(_NormalMap, sampler_NormalMap, texCoord, 1)) * 0.5f + 0.5f;
|
|
surfaceData.normalWS.w = totalBlend;
|
|
#endif
|
|
}
|