learn-opengl에 나온 계산들
vs
Frag 위치
1
FragPos = vec3(model * vec4(aPos, 1.0));
Normal 행렬
1
Normal = mat3(transpose(inverse(model))) * aNormal;
fs
frag에서 광원까지의 방향
1
vec3 lightDir = normalize(light.position - FragPos);
1
FragPos = vec3(model * vec4(aPos, 1.0));
1
Normal = mat3(transpose(inverse(model))) * aNormal;
1
vec3 lightDir = normalize(light.position - FragPos);
A new version of content is available.