From 89231426e34d2c93a7ad627f4c9c13b13eb7a1c6 Mon Sep 17 00:00:00 2001 From: stele Date: Sat, 22 Dec 2018 16:44:22 +0100 Subject: [PATCH] Changed reflection value to normalmaps alfa. Fixed order in color conversion in stars shader. --- shaders/mat_normalmap.frag | 4 ++-- shaders/mat_reflmap.frag | 4 ++-- shaders/mat_stars.frag | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/shaders/mat_normalmap.frag b/shaders/mat_normalmap.frag index 044efe34..c4b7a4fa 100644 --- a/shaders/mat_normalmap.frag +++ b/shaders/mat_normalmap.frag @@ -22,7 +22,7 @@ layout(location = 1) out vec4 out_motion; #texture (diffuse, 0, sRGB_A) uniform sampler2D diffuse; -#texture (normalmap, 1, RGB) +#texture (normalmap, 1, RGBA) uniform sampler2D normalmap; #if SHADOWMAP_ENABLED @@ -58,7 +58,7 @@ void main() { vec2 part = calc_dir_light(lights[0]); vec3 c = (part.x * param[1].x + part.y * param[1].y) * calc_shadow() * lights[0].color; - result += mix(c, envcolor, param[1].z); + result += mix(c, envcolor, param[1].z * texture(normalmap, f_coord).a); } for (uint i = 1U; i < lights_count; i++) diff --git a/shaders/mat_reflmap.frag b/shaders/mat_reflmap.frag index 50afdd38..fc1df7d3 100644 --- a/shaders/mat_reflmap.frag +++ b/shaders/mat_reflmap.frag @@ -21,7 +21,7 @@ layout(location = 1) out vec4 out_motion; #texture (diffuse, 0, sRGB_A) uniform sampler2D diffuse; -#texture (reflmap, 1, R) +#texture (reflmap, 1, RGBA) uniform sampler2D reflmap; #if SHADOWMAP_ENABLED @@ -56,7 +56,7 @@ void main() { vec2 part = calc_dir_light(lights[0]); vec3 c = (part.x * param[1].x + part.y * param[1].y) * calc_shadow() * lights[0].color; - result += mix(c, envcolor, param[1].z * texture(reflmap, f_coord).r); + result += mix(c, envcolor, param[1].z * texture(reflmap, f_coord).a); } for (uint i = 1U; i < lights_count; i++) diff --git a/shaders/mat_stars.frag b/shaders/mat_stars.frag index 1a324857..aabc3ef3 100644 --- a/shaders/mat_stars.frag +++ b/shaders/mat_stars.frag @@ -17,7 +17,7 @@ void main() discard; // color data space is shared with normals, ugh - vec4 color = vec4(pow(f_normal_raw.bgr, vec3(2.2)), 1.0f); + vec4 color = vec4(pow(f_normal_raw.rgb, vec3(2.2)), 1.0f); #if POSTFX_ENABLED out_color = color; #else