yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Lujin WangFix DebugCompilationUnit to reference main shader file instead of header files (#7957)ed9f42361

master
457 B18 linesraw
1#ifndef SHADER_UTILS_SLANG
2#define SHADER_UTILS_SLANG
3
4// Helper function to calculate distance from center
5float calculateDistanceFromCenter(float2 uv)
6{
7    float2 center = float2(0.5, 0.5);
8    return length(uv - center);
9}
10
11// Additional utility function - simple smoothstep fade
12float createRadialFade(float2 uv, float radius)
13{
14    float dist = calculateDistanceFromCenter(uv);
15    return smoothstep(radius, 0.0, dist);
16}
17
18#endif // SHADER_UTILS_SLANG