I'm working on a compute shader for a 3d texture where I want to evaluate pixels in a specific order, is there any way to do this?
let's say that I have made a texture using the following code;
tex = new RenderTexture(64, 64, 0);
tex.volumeDepth = 6;
tex.isVolume = true;
tex.enableRandomWrite = true;
tex.Create();
Now let's say that for example I want to make the following computation on the gpu rather then cpu:
tex[0]=basetex //all values where z =0 are some basic 2d texture
for(int z=1;z<6;z++){ //loop over every z level
for(int x=1;x<64;x++){ //loop over every x level
for(int y=1;y<64;y++){ //loop over every y value
tex[x][y][z-1]=tex[x-1][y][z-1]+tex[x-1][y][z-1]+tex[x][y-1][z-1]+tex[x][y+1][z-1] //add all values next to this pixel on the z value bellow
}
}
}
↧