16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 06:59:18 +02:00

Cleanup of vertex shader by @tmj.

2-channel normalmaps with Z-component reconstruction.
Normal vectors passed from fragment shaders to lightning calculations.
This commit is contained in:
stele
2019-05-03 17:32:46 +02:00
parent 158ebb9c70
commit 410e1452f6
4 changed files with 30 additions and 12 deletions

View File

@@ -30,9 +30,11 @@ float calc_shadow()
vec2 calc_light(vec3 light_dir)
{
#ifdef NORMALMAP
vec3 normal = normalize(f_tbn * normalize(texture(normalmap, f_coord).rgb * 2.0 - 1.0));
vec3 normal = normal;
#elif defined(WATER)
vec3 normal = normal_d;
#elif defined(PARALLAX)
vec3 normal = normal_p;
#else
vec3 normal = normalize(f_normal);
#endif