Hi!

I'm having issues with cube enviroment shaders in a racing game too. I'm trying, without sucess, to move the enviroment texture following x/y coordinates. Example: in a racing game, a enviroment texture should move with the car's velocity. But according to the shader's logic in the link given by broozar, the material just render the first time and the texture still in that position.

Here's a piece of the code:

function mtl_envmap_view()
{
mat_set(mtl.matrix,matViewInv);

mtl.matrix41=0;
mtl.matrix42=0;
mtl.matrix43=0;
}

Using this code, I tried to change the '0' values to floatd(my.y*(-1)/10, 64) and that resulted in a empty pointer error. So I tried this:

if(me!=NULL)
{
mtl.matrix41=floatd(my.y*(-1)/10, 64);
mtl.matrix42=0;
mtl.matrix43=floatd(my.x*(-1)/10, 64);
}

With that, the game works, but the texture still static. Please, is there some way to make the enviroment texture move?

Thank you very much!