Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

b3rs3rk

Quake bsp and per pixel lighting

This topic is 5219 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i have a quake bsp map loader and i want to use per pixel lighting...but how can i compute tangents and binomial ? for now i''m doing this: for (every i face){ for(every j vertex in the face){ compute the tangent for vertexs j, j+1 and j+2 binomial = cross(tangent,face.normal) } } but the results are so wierd!

Share this post


Link to post
Share on other sites
Advertisement
Does PPL work on other objects? How are you calculating TBN matrix?

You should never let your fears become the boundaries of your dreams.

Share this post


Link to post
Share on other sites
the bsp format stores automatically the normal for every face.. then i cycle through faces and compute the tangents and the binomials using this equation:

Vec1 = Vertex3 – Vertex2
Vec2 = Vertex1 – Vertex2
DeltaU1 = Vertex3.u - Vertex2.u
DeltaU2 = Vertex1.u - Vertex2.u
Tangent = |DeltaU2*Vec1-DeltaU1*Vec2|

but something doesn''t work and i dunno why :°

Share this post


Link to post
Share on other sites

  • 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!