Timeline for Help with calculating tangent/binormal in Vulkan fragment shader using GLSL
Current License: CC BY-SA 4.0
9 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 12, 2023 at 12:28 | vote | accept | krz | ||
| Dec 12, 2023 at 12:28 | answer | added | krz | timeline score: 0 | |
| Mar 10, 2023 at 18:24 | comment | added | krz | but what I don't understand is why glTF-PBR demo that does the same - has smooth triangle shading whereas my attempts at doing the same result in visible triangle edges | |
| Mar 10, 2023 at 18:17 | comment | added | DMGregory♦ | That's coming from the fact that you're computing your tangent vectors per fragment - so they're using partial derivatives that are constant over each triangle but discontinuous at triangle edges - instead of computing them per vertex and sending them to the GPU as vertex attributes, so all adjacent triangles agree about the tangents along their shared edges. | |
| Mar 10, 2023 at 17:49 | comment | added | krz | Figures, but when I'm reading normal from normal map texture - I get another weird result where triangles are improperly shaded and are visible | |
| Mar 10, 2023 at 17:38 | comment | added | DMGregory♦ |
Why are you multiplying the same normal used to calculate the TBN matrix by that matrix? This is not a geometrically meaningful operation. A TBN matrix is useful for transforming a tangent space normal read from a normal map texture into world space, but as shown here, the variable normal is treated as though it's already in world space.
|
|
| Mar 10, 2023 at 16:21 | history | edited | krz | CC BY-SA 4.0 |
deleted 4 characters in body
|
| S Mar 10, 2023 at 15:50 | review | First questions | |||
| Mar 11, 2023 at 8:43 | |||||
| S Mar 10, 2023 at 15:50 | history | asked | krz | CC BY-SA 4.0 |