Initial Commit

This commit is contained in:
Toomas Tamm
2020-11-28 16:54:41 +02:00
parent 97292ee26e
commit ea967135f2
4217 changed files with 2945663 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
#pragma kernel Converter
struct grassCell {
uint grassElementIndexes[512];//map to grass elements
};
StructuredBuffer<grassCell> grassCellBuffer;
StructuredBuffer<uint> grassCellIndexBuffer;
AppendStructuredBuffer<uint> outGrassBuffer;
[numthreads(8,8,8)]
void Converter (uint callIndex : SV_GroupIndex, uint3 groupID : SV_GroupID) {
uint realIndex = groupID.x + groupID.y + groupID.z;
uint cellIndex = grassCellIndexBuffer[realIndex];
grassCell cell = grassCellBuffer[ cellIndex ];
int elementIndex = callIndex;//Correct
uint objIndex = cell.grassElementIndexes[elementIndex];
if(objIndex != 0) outGrassBuffer.Append(objIndex);
}
//So the error seems to have been the usement of the wrong ID... but there must have been something else as well