Oolite test release 1.74.2

News and discussion of the PC port of Oolite.

Moderators: winston, another_commander

User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post 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.)
Post Reply