TEXMAP extension thoughts and findings.


Re: TEXMAP extension thoughts and findings.
#13
For |a| < 360 my implementation simply pads the texture out (with alpha = 0) to the equivalent of 360 degrees. For |a| < 180 this isn't necessary since you can just use clamping mode, but I haven't made that optimization yet. Wink

(Of course, as you note, a pixel shader would also work... or for that matter you could also make it work in GL 1.3 using multitexturing.)

The thing about matrices and coordinate spaces is, I think, an important point. Basically, the point is that a subfile inclusion matrix transforms the *entire* subfile - so it should transform textures too. Otherwise we end up in a situation where mirroring a part causes it to appear "correct" in texture-mapping renderers, but mirrored in renderers that use the fallback geometry. (Yes, of course people should try to avoid mirroring parts, but that's not to say it doesn't happen.) As for scaling/skewing, even if we ignore the possibility of users doing that deliberately, note that any nontrivial rotation also creates some slight scaling/skewing because the coordinates can't be expressed with perfect precision.

A cheap way to deal with it, correctly handling mirroring but not skewing, would be to check if the determinant is negative, and if so flip the "a" coordinates (for cylindrical) or the "b" coordinates (for spherical.)
Reply
« Next Oldest | Next Newest »



Messages In This Thread
Re: TEXMAP extension thoughts and findings. - by Benjamin Moody - 2014-08-16, 19:33

Forum Jump:


Users browsing this thread: 1 Guest(s)