Files
client/Editor/Internal Data/Third Party/Shaders/Layers/PseudoRandomNoise.hlsl
T
2026-07-31 19:29:07 +03:00

21 lines
547 B
HLSL

// Licensed under the Non-Profit Open Software License version 3.0
// Variables
uint PseudoRandomNoiseSeed;
// Kernel
[numthreads(32,1,1)]
void PseudoRandomNoise (uint3 id : SV_DispatchThreadID)
{
if(id.x < HeightMapLength){ // Keep in bounds
// Calculate vector
uint2 pos = IndexToVector(id.x, HeightMapResolution);
// Generate noise
float noise = Random((pos.x + (pos.y * HeightMapResolution)) * PseudoRandomNoiseSeed);
// Update buffer
HeightBuffer[id.x] = noise;
}
}