123456789101112131415161718 |
- // Each #kernel tells which function to compile; you can have many kernels
- #pragma kernel VerticesComputer
- // Create a RenderTexture with enableRandomWrite flag and set it
- // with cs.SetTexture
- RWStructuredBuffer<float3> Result;
- RWStructuredBuffer<float> InputArray;
- //int MemoryIndex;
- [numthreads(389,1,1)]
- void VerticesComputer(uint3 id : SV_DispatchThreadID)
- {
- int index = id.x * 3;
- Result[id.x].x = InputArray[index];
- Result[id.x].y = InputArray[index + 1];
- Result[id.x].z = -InputArray[index + 2];
- }
|