- Home /
Question by
thijser · Mar 18, 2015 at 09:15 AM ·
unity 5shadersunity5compute shader
compute shader in order access of pixels
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
}
}
}
Comment
Your answer
Follow this Question
Related Questions
Unity 5 Standard shader to legacy shader 0 Answers
Vuforia simultaneous tracked objects 0 Answers
How to set startWidth and endWidth of LineRenderer in Unity 5.5.1f1? 2 Answers
GetComponentInChıldren does not work 1 Answer
IClone character hair issue 2 Answers