Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
Posted 22 August 2011 - 09:54 PM
Posted 22 August 2011 - 10:04 PM
I am just starting to get into normal/bump mapping, and am curious what the "current modern method" is for doing normal mapping. I have a lot of older 3D books which make passing references to computing tangents and normals. I currently include normals in my geometry vertex format, but haven't yet seen anything that exports tangents with the geometry.
Aside from not yet knowing anything about tangents (or binormals, or bitangents, ...), I'm also using OpenGL 3.2 and trying to avoid any old deprecated methodologies. I can only assume that tangents are still needed for normal mapping (I haven't read anything to say otherwise), but is it still best to precompute them and add them to the vertex format? Or are they computed as-needed in shaders these days?
What would be a good (modern/shader) reference for learning tangents (if needed) and the basics of normal mapping?
Posted 23 August 2011 - 12:13 AM
Ehh, depends on the platform. A bit of extra ALU isn't going to slow down any modern GPU.
Posted 23 August 2011 - 01:26 AM
Previously "Krohm"
Posted 23 August 2011 - 01:47 AM
I work on this stuff: The 31st | Tombstone Engine | Foundations of Game Engine Development | Game Engine Gems | OpenGEX
Posted 23 August 2011 - 02:18 AM
Note that using the derivative instructions to generate tangents and bitangents results in a severe quality reduction. It's much better to use precomputed per-vertex tangents.
Here are some comparison images. In each one, the region left of the white line uses the derivative instructions as described by the paper above. The region right of the white line uses the conventional method in which tangents are precomputed per-vertex and bitangents are generated in the vertex shader.
Posted 23 August 2011 - 09:59 AM
Posted 23 August 2011 - 07:42 PM
Posted 23 August 2011 - 08:31 PM
The normal, tangent and binormal can be put together into a 3x3 matrix which describes 'tangent space'.Does anyone have any references on why tangents and bitangents and such are used in normal mapping?
I understand that tangent space is a plane that sits on a surface perpendicular to the normal, and I see lots of documents that give the math for tangent space and calculating the tangents for a vertex. But I haven't yet found a document which explains why tangents and tangent space is important.
Posted 23 August 2011 - 11:20 PM
The best article I've found on tangents so far is this one, but even it assumes that I already want a tangent space and want it aligned a certain way.
I work on this stuff: The 31st | Tombstone Engine | Foundations of Game Engine Development | Game Engine Gems | OpenGEX
Posted 24 August 2011 - 01:24 PM
Posted 25 August 2011 - 01:08 PM
FWIW - Mikkelsen posted a follow up (http://mmikkelsen3d.blogspot.com/) to that unparametrized bump mapping paper, making use of a precomputed derivative map to increase visual quality.
Posted 31 August 2011 - 06:58 AM
I've implemented this approach using OpenGL and got on 460gtx -11% in comparison with tangent space approachFWIW - Mikkelsen posted a follow up (http://mmikkelsen3d.blogspot.com/) to that unparametrized bump mapping paper, making use of a precomputed derivative map to increase visual quality.
Posted 31 August 2011 - 09:19 AM
Tangents and binormals (/bitangents) are perpendicular vectors....
Posted 01 September 2011 - 06:21 AM
I've implemented this approach using OpenGL and got on 460gtx -11% in comparison with tangent space approachFWIW - Mikkelsen posted a follow up (http://mmikkelsen3d.blogspot.com/) to that unparametrized bump mapping paper, making use of a precomputed derivative map to increase visual quality.
Posted 02 September 2011 - 01:11 AM
Is that really the case?Tangents and binormals (/bitangents) are perpendicular vectors....
Posted 02 September 2011 - 07:03 AM
Seams in UV mapping, or hard edges for normal smoothing, causes split vertices. In those cases you can't average the tangents for the edge, and the tangent spaces for the neighboring triangles are not continuous.while I'm hijacking this thread anyway, 2nd thing that confuses me, is it really valid to average the tangents matrices on vertices? they usually represent individual spaces for one triangle(-edge) a neighboring triangle might have a completely unrelated space which is even flipped due to UV mirroring or something. I think if the orthogonalization would remove anything but rotation, this could work if you propagate per triangle the flipping bit, but that leads to my first question.
Posted 02 September 2011 - 08:37 AM
that's kind of obviousSeams in UV mapping, or hard edges for normal smoothing, causes split vertices. In those cases you can't average the tangents for the edge, and the tangent spaces for the neighboring triangles are not continuous.while I'm hijacking this thread anyway, 2nd thing that confuses me, is it really valid to average the tangents matrices on vertices? they usually represent individual spaces for one triangle(-edge) a neighboring triangle might have a completely unrelated space which is even flipped due to UV mirroring or something. I think if the orthogonalization would remove anything but rotation, this could work if you propagate per triangle the flipping bit, but that leads to my first question.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC.