So I heard about Compute Shaders and wanted to try it out and learn to program in HLSL and etc. So I have a pretty “noob” question. I have followed the tutorial by David Kuri about how to do raytracing in Unity. And I wanted to have a slider so I can in runtime choose how many Spheres and I have split them up in rows and columns. But when I update the rows the columns dont update. Here is a video of what I mean more specifically:
Here is my current code for updating the rows and columns
for (int x = 0; x < SphereColummns; x++)
{
IntersectSphere(ray, bestHit, float4(origin, 3.0f, rowsOrigin, 1.0f));
origin += 5;
}
for (int y = 0; y < SphereRows; y++)
{
IntersectSphere(ray, bestHit, float4(origin, 3.0f, rowsOrigin, 1.0f));
rowsOrigin += 5;
}