Shader optimizations
This commit is contained in:
@ -24,7 +24,7 @@ public class Player : MonoBehaviour
|
||||
|
||||
VoxelRaycastGPU.Ray[] rays = new VoxelRaycastGPU.Ray[rayCount];
|
||||
FillRaysArray(rays);
|
||||
voxelManager.gpuRayCaster.Init(rayCount, rays, 3);
|
||||
voxelManager.gpuRayCaster.Init(rayCount, rays, 5);
|
||||
}
|
||||
|
||||
void Cast( ref VoxelRaycastGPU.BatchData[] batchData, int batchCount, int iIteration )
|
||||
|
||||
@ -95,18 +95,20 @@ public class VoxelRaycastGpuManager
|
||||
countBuffer.GetData(countArr);
|
||||
currentCount = countArr[0];
|
||||
|
||||
sw.Stop();
|
||||
|
||||
VoxelRaycastGPU.BatchData[] hits = new VoxelRaycastGPU.BatchData[currentCount];
|
||||
hitBuffer.GetData(hits, 0, 0, currentCount);
|
||||
for( int i = 0; i < hits.Length; i++ )
|
||||
{
|
||||
GameObject sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere);
|
||||
sphere.transform.position = hits[i].origin;
|
||||
sphere.transform.localScale = Vector3.one * 0.5f;
|
||||
}
|
||||
|
||||
sw.Start();
|
||||
/**
|
||||
sw.Stop();
|
||||
|
||||
VoxelRaycastGPU.BatchData[] hits = new VoxelRaycastGPU.BatchData[currentCount];
|
||||
hitBuffer.GetData(hits, 0, 0, currentCount);
|
||||
for( int i = 0; i < hits.Length; i++ )
|
||||
{
|
||||
GameObject sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere);
|
||||
sphere.transform.position = hits[i].origin;
|
||||
sphere.transform.localScale = Vector3.one * 0.5f;
|
||||
}
|
||||
|
||||
sw.Start();
|
||||
*/
|
||||
|
||||
iteration++;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user