Comments on: Avoid Degenerate UV Maps When Using Normal Maps https:/2012/01/avoid-degenerate-uv-maps-when-using-normal-maps/ Developer resources for the X-Plane flight simulator Sat, 21 Jan 2012 18:08:48 +0000 hourly 1 https://wordpress.org/?v=6.6.1 By: Jonathan https:/2012/01/avoid-degenerate-uv-maps-when-using-normal-maps/#comment-4049 Sat, 21 Jan 2012 18:08:48 +0000 http://www.x-plane.com/blog/?p=3885#comment-4049 In reply to Ben Supnik.

Yeah, that’s another factor. I got the impression that ATI/AMD is more tolerant. And it usually ends up with the ‘right’ results, which was my point about the usefulness of things. Kinda puts a damper on “Beware of bugs in the above code; I have only proved it correct, not tried it.” (Donald Knuth)

]]>
By: Ben Supnik https:/2012/01/avoid-degenerate-uv-maps-when-using-normal-maps/#comment-4045 Sat, 21 Jan 2012 00:39:52 +0000 http://www.x-plane.com/blog/?p=3885#comment-4045 In reply to Jonathan.

I can’t say that all GPUs have this problem – just at least one I have tested. I definitely see different results when I write crappy shaders – the annoying case is when the hardware I happen to be using accepts my bad code and I find out later.

]]>
By: Jonathan https:/2012/01/avoid-degenerate-uv-maps-when-using-normal-maps/#comment-4044 Fri, 20 Jan 2012 03:29:28 +0000 http://www.x-plane.com/blog/?p=3885#comment-4044 In reply to Ben Supnik.

I had a look at some specs. OpenGL specifically doesn’t care about NaNs. An implementation can do whatever it wants with them, as long as it doesn’t crash. It appears Direct3D does care, probably in the blender as well. Also, the uniformity across the GPU must be a good thing (even if 0 * NaN is 0 most of the time anyway, mathematically speaking). I just didn’t really expect this.

]]>
By: Ben Supnik https:/2012/01/avoid-degenerate-uv-maps-when-using-normal-maps/#comment-4040 Wed, 18 Jan 2012 05:03:48 +0000 http://www.x-plane.com/blog/?p=3885#comment-4040 In reply to Jonathan.

The floating point rules say that NaNs have to be treated as standard IEEE NaNs, that is, NaN * anything = NaN. Soo…once you burn a NaN into the framebuffer, I think the GPU is required to do the annoying thing, e.g. preserve the NaN.

In this case there’s often no accum; some hardware may optimize out alpha=1 in the blender, but you’ll still end up with some hosed bits. The _shaders_ have to follow IEEE so no math optimization there.

]]>
By: Jonathan https:/2012/01/avoid-degenerate-uv-maps-when-using-normal-maps/#comment-4039 Tue, 17 Jan 2012 19:47:15 +0000 http://www.x-plane.com/blog/?p=3885#comment-4039 Will it blend? That is the question.

I wonder. Wouldn’t hardware optimize optimize cases like alpha=1? Or does it also know there are NaNs in the framebuffer? Even though it wouldn’t make much sense most of the time, as you can see here. Well, at least it might not bleed through any and all geometry.

]]>