Files
beyond/Assets/ThirdParty/SDF Baker/Experiments/VolumeComputeMethods.compute
2024-11-20 15:21:28 +01:00

12 lines
351 B
Plaintext

// Each #kernel tells which function to compile; you can have many kernels
#pragma kernel ExtractVolumeData
Texture3D<float> volume;
RWStructuredBuffer<float> values;
int3 dimensions;
[numthreads(1,1,1)]
void ExtractVolumeData(uint3 id : SV_DispatchThreadID)
{
values[id.z * dimensions.y * dimensions.x + id.y * dimensions.x + id.x] = volume[id];
}