DepthComputeShader.compute 531 B

123456789101112131415161718
  1. // Each #kernel tells which function to compile; you can have many kernels
  2. #pragma kernel CSMain
  3. // Create a RenderTexture with enableRandomWrite flag and set it
  4. // with cs.SetTexture
  5. RWTexture2D<float4> tex;
  6. RWStructuredBuffer<float4> output;
  7. [numthreads(8,8,1)]
  8. void CSMain (uint3 id : SV_DispatchThreadID)
  9. {
  10. // TODO: insert actual code here!
  11. float4 c0 = tex[id.xy];
  12. //tex[id.xy] = float4(id.x & id.y, (id.x & 15)/15.0, (id.y & 15)/15.0, 0.0);
  13. output[id.x] = c0.r; // dit doet niet wat het moet doen (!!)
  14. }