#### Archived

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

# Quake bsp and per pixel lighting

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

## 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 on other sites
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 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 :°

1. 1
Rutin
38
2. 2
3. 3
4. 4
5. 5

• 11
• 9
• 12
• 14
• 9
• ### Forum Statistics

• Total Topics
633350
• Total Posts
3011470
• ### Who's Online (See full list)

There are no registered users currently online

×