3D Texture on glsl


im trying to make a 3D Texture on my program, but i would like to change the third coordinate based on the spherical position of the camera from the pixel. so imagine it runs each vertex on the vertex shader, the shaders calculate the direction between the vertex and the camera. based on the camera position, the index sent to fragment shader to decide the value of the third texture coordinate. here is the vertex shader:


and here is the fragment shader:


im not sure which part is wrong but i get the wrong effect not as i expected. i presume there’s something wrong with the code but i cant figure out which one. can someone help me?

thanks in advance

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.