16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 13:39:18 +02:00

Parallax occlusion shader

This commit is contained in:
stele
2019-05-02 22:24:44 +02:00
parent 8aca8bffe4
commit 158ebb9c70
2 changed files with 145 additions and 1 deletions

View File

@@ -10,7 +10,7 @@ out vec4 f_pos;
out mat3 f_tbn;
out vec4 f_tangent;
out vec4 f_light_pos;
out vec3 TangentFragPos;
out vec4 f_clip_pos;
out vec4 f_clip_future_pos;
@@ -35,4 +35,6 @@ void main()
vec3 B = normalize(modelviewnormal * cross(v_normal, v_tangent.xyz) * v_tangent.w);
vec3 N = normalize(modelviewnormal * v_normal);
f_tbn = mat3(T, B, N);
mat3 TBN = transpose(mat3(T, B, N));
TangentFragPos = TBN * f_pos.xyz;
}