Jump to content
  • Advertisement

six6

Member
  • Content Count

    2
  • Joined

  • Last visited

Community Reputation

2 Neutral

About six6

  • Rank
    Newbie

Personal Information

  • Interests
    Programming

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. @cebugdev Hi again. I assume you are still talking about this equation Q − P0 = (u − u0)T + (v − v0)B. Just as what you might have known when approximating lighting with phong reflection model, the equation is valid as long as they are all in the same space. But typically this equation is used in the model space, as you need to construct a tangent-to-model/world TBN matrix for normal mapping, and you most likely have the necessary variables ready in model space.
  2. Hi there Really appreciate your desire to learn the proof instead of the application only. But sometimes people don't ask question like this might not because they only take whatever they read, there is a possibly that the "proof" is too obvious so no one asks. Back to the equation: Q − P0 = (u − u0)T + (v − v0)B First, let’s make sure we understand what the equation means. One point to note is u and v are not vectors, neither their differences (Δu, Δv) are. According to your last post in the Maths thread “I understand we need to get two vectors that is why the difference of U and V vectors are computed to form a vector, but i dont understand why it needs to be dot products to T and added to difference of V vectors and dot product to B.”, it seems you mistook the notation, so let’s commonly agree no dot product happens here like you mentioned. Next, let’s ask ourselves a question, what is a normal map? It is a texture containing normals in tangent space, (I assume you understand what space and basis are) which is local to the surface of a triangle. And what is a triangle in its local space? A plane lying on the x-plane! To ease your life, let's call it a 2D triangle. (Triangle on itself is always planer, so not really meaningful to say it is 2D, but maybe you can understand it easier in this way) So this gives you some hints why the equation only has 2 elements on the right hand side instead of 3. What if we mark the 3 pairs of texture coordinates of a triangle’s vertices on the normal map? We will get a 2D triangle. And it is the same triangle but just with different scale! For a 2D triangle, you can express any point inside it by using the x-axis and y-axis (or z-axis depends on your coordinate system) unit vector only. Remember the normal map is in tangent space? So in this case, the x-axis, y-axis are the tangent and bitangent. (But be careful we do not narrow it to a 2D space problem, it is still in 3D space but with the one of the basis, normal, naively pointing upward, which is the up-vector) Finally, the source of this equation to me is more like an intuitive deduction than a proof. If we are going to express it verbally, it should sounds something like “the vector from vertex 0 of this triangle to an arbitrary point Q in the triangle CAN BE REPRESENTED BY the combination of tangent and bitangent with the respective scale of delta u and delta v.” Why do we not need a scale of normal? Because if you are already standing on a vertex of a triangle, to go to another vertex, you do not need to fly you just walk on the plane. Now hopefully you understand the equation above, so the mathematically deduction of tangent and bitangent is left to your practice. Let’s get back here and discuss if you face any difficulties. (This website actually explained it quite well on the maths behind. Iterate on it rather than reading many sources at one time might help you more. https://learnopengl.com/#!Advanced-Lighting/Normal-Mapping)
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!