Skip to content
Snippets Groups Projects
Commit 1ff876a9 authored by Graham Linden's avatar Graham Linden
Browse files

SL-11071

Make sun disc and moon shaders use sRGB hardware tex sampling.

Remove sun disc shader use of fullbright transport (fogging).
parent bfce96d6
No related branches found
No related tags found
No related merge requests found
......@@ -44,8 +44,6 @@ uniform sampler2D altDiffuseMap;
uniform float blend_factor; // interp factor between moon A/B
VARYING vec2 vary_texcoord0;
vec3 srgb_to_linear(vec3 c);
void main()
{
vec4 moonA = texture2D(diffuseMap, vary_texcoord0.xy);
......@@ -60,7 +58,6 @@ void main()
vec3 exp = vec3(1.0 - mix * moon_brightness) * 2.0 - 1.0;
c.rgb = pow(c.rgb, exp);
c.rgb = srgb_to_linear(c.rgb);
//c.rgb *= moonlight_color.rgb;
......
......@@ -49,7 +49,8 @@ void main()
vec4 c = mix(sunDiscA, sunDiscB, blend_factor);
c.rgb = clamp(c.rgb, vec3(0), vec3(1));
c.rgb = pow(c.rgb, vec3(0.7f));
c.rgb = fullbrightAtmosTransport(c.rgb);
//c.rgb = fullbrightAtmosTransport(c.rgb);
c.rgb = fullbrightScaleSoftClip(c.rgb);
// SL-9806 stars poke through
......
......@@ -484,6 +484,9 @@ void LLDrawPoolWLSky::renderHeavenlyBodies()
{
sun_shader->bind();
gGL.getTexUnit(0)->setTextureColorSpace(LLTexUnit::TCS_SRGB);
gGL.getTexUnit(1)->setTextureColorSpace(LLTexUnit::TCS_SRGB);
if (tex_a && (!tex_b || (tex_a == tex_b)))
{
// Bind current and next sun textures
......@@ -532,6 +535,9 @@ void LLDrawPoolWLSky::renderHeavenlyBodies()
{
moon_shader->bind();
gGL.getTexUnit(0)->setTextureColorSpace(LLTexUnit::TCS_SRGB);
gGL.getTexUnit(1)->setTextureColorSpace(LLTexUnit::TCS_SRGB);
if (tex_a && (!tex_b || (tex_a == tex_b)))
{
// Bind current and next sun textures
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment