Created
August 22, 2018 16:13
-
-
Save zyouyowa/6ae8e2e75a21e275a07a6b8ce7863e48 to your computer and use it in GitHub Desktop.
RenderTextureにdataをプロットするだけ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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