UnityGame/Library/PackageCache/com.unity.render-pipelines.universal/Shaders/2D/Include/SurfaceData2D.hlsl

36 lines
819 B
HLSL
Raw Normal View History

2024-10-27 10:53:47 +03:00
#ifndef SURFACE_DATA_2D_INCLUDED
#define SURFACE_DATA_2D_INCLUDED
struct SurfaceData2D
{
half3 albedo;
half alpha;
half4 mask;
half3 normalTS;
};
void InitializeSurfaceData(half3 albedo, half alpha, half4 mask, half3 normalTS, out SurfaceData2D surfaceData)
{
surfaceData = (SurfaceData2D)0;
surfaceData.albedo = albedo;
surfaceData.alpha = alpha;
surfaceData.mask = mask;
surfaceData.normalTS = normalTS;
}
void InitializeSurfaceData(half3 albedo, half alpha, half4 mask, out SurfaceData2D surfaceData)
{
const half3 normalTS = half3(0, 0, 1);
InitializeSurfaceData(albedo, alpha, mask, normalTS, surfaceData);
}
void InitializeSurfaceData(half3 albedo, half alpha, out SurfaceData2D surfaceData)
{
InitializeSurfaceData(albedo, alpha, 1, surfaceData);
}
#endif