Initial commit
This commit is contained in:
1 parent
ee9615239e
commit
16feac691f
4093 files changed
+1030491
No files matched your search
@@ -0,0 +1,29 @@
|
||||
// Each #kernel tells which function to compile; you can have many kernels
|
||||
#pragma kernel CSMain
|
||||
|
||||
// Create a RenderTexture with enableRandomWrite flag and set it
|
||||
// with cs.SetTexture
|
||||
|
||||
struct TerrainMinMax
|
||||
{
|
||||
float minHeight;
|
||||
float maxHeight;
|
||||
};
|
||||
|
||||
|
||||
Texture2D<float4> Input;
|
||||
RWStructuredBuffer<TerrainMinMax>outputBuffer;
|
||||
|
||||
[numthreads(8,8,1)]
|
||||
void CSMain (uint3 id : SV_DispatchThreadID)
|
||||
{
|
||||
if(Input[id.xy].r>outputBuffer[0].maxHeight)
|
||||
{
|
||||
outputBuffer[0].maxHeight = Input[id.xy].r;
|
||||
}
|
||||
else if(Input[id.xy].r<outputBuffer[0].minHeight)
|
||||
{
|
||||
outputBuffer[0].minHeight = Input[id.xy].r;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user