normalmap.vert
Variables and Uniforms
Input variables and Uniforms
add tangent space in variables
// added for LabA08 Normal Map
in layout(location=3) vec3 aTangent;
in layout(location=4) vec3 aBitangent;Uniforms
uniform vec3 lightPos;
uniform vec3 viewPos;Outpu variables
add tangent space out variables
out vec3 tangentLightPos;
out vec3 tangentViewPos;
out vec3 tangentFragPos;comment out normal
in main()
Comment out the normal transform
Generate the inverse (transpose) of the tangent space matrix TBN
Transform lightPos, viewPos and fragPos to the tangent space
Full Source Code
Last updated