Skip to content

Instantly share code, notes, and snippets.

@zyouyowa
Created August 22, 2018 16:13
Show Gist options
  • Save zyouyowa/6ae8e2e75a21e275a07a6b8ce7863e48 to your computer and use it in GitHub Desktop.
Save zyouyowa/6ae8e2e75a21e275a07a6b8ce7863e48 to your computer and use it in GitHub Desktop.
RenderTextureにdataをプロットするだけ
#pragma kernel ShowData
StructuredBuffer<float> data;
RWTexture2D<float4> Result;
[numthreads(1024,1,1)]
void ShowData (uint id : SV_DispatchThreadID)
{
for (int i = 0; i < 256; i++) {
uint2 idx = uint2(id, i);
Result[idx] = float4(255, 255, 255, 255);
}
uint2 px = uint2(id, (1 + data[id]) * 128);
Result[px] = float4(255, 0, 0, 255);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment