Home [shader] 노트
Post
Cancel

[shader] 노트

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);
This post is licensed under CC BY 4.0 by the author.

[learn-opengl] Lighting: Light casters

[learn-opengl] Lighting: Multiple lights