12 lines
351 B
Plaintext
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];
|
|
} |