Page 2 of 2

Posted: Mon Jul 26, 2010 1:55 pm
by JensAyton
Griff wrote:

Code: Select all

   vEnvTexCoord.x = r.x/m + 0.5;
   vEnvTexCoord.y = r.y/m + 0.5;
it's written as vEnvTexCoord.s & vEnvTexCoord.t at the moment, maybe the fragment shader doesn't like that?
That definitely will not make a difference. However, for efficiency it should be written:

Code: Select all

vEnvTexCoord = r / m + 0.5;
Repeating identical calculations for different components of the same vector is always the Wrong Thing. (The driver’s shader compiler ought to fix this for you, but it’s not guaranteed.)