Files
com.misaki.art-tools/Shader/Include/Common/NoiseCommon.hlsl
2024-09-16 00:08:10 +09:00

59 lines
943 B
HLSL

float wglnoise_mod(float x, float y)
{
return x - y * floor(x / y);
}
float2 wglnoise_mod(float2 x, float2 y)
{
return x - y * floor(x / y);
}
float3 wglnoise_mod(float3 x, float3 y)
{
return x - y * floor(x / y);
}
float4 wglnoise_mod(float4 x, float4 y)
{
return x - y * floor(x / y);
}
float2 wglnoise_fade(float2 t)
{
return t * t * t * (t * (t * 6 - 15) + 10);
}
float3 wglnoise_fade(float3 t)
{
return t * t * t * (t * (t * 6 - 15) + 10);
}
float wglnoise_mod289(float x)
{
return x - floor(x / 289) * 289;
}
float2 wglnoise_mod289(float2 x)
{
return x - floor(x / 289) * 289;
}
float3 wglnoise_mod289(float3 x)
{
return x - floor(x / 289) * 289;
}
float4 wglnoise_mod289(float4 x)
{
return x - floor(x / 289) * 289;
}
float3 wglnoise_permute(float3 x)
{
return wglnoise_mod289((x * 34 + 1) * x);
}
float4 wglnoise_permute(float4 x)
{
return wglnoise_mod289((x * 34 + 1) * x);
}