diff options
author | Graham Linden <graham@lindenlab.com> | 2018-11-01 20:28:47 +0100 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2018-11-01 20:28:47 +0100 |
commit | 4f267a5723e7da2de36b9f2295e4942a4c8bf6c5 (patch) | |
tree | c186a8888794732f32bba406b7bb66b4cafd4d11 /indra/newview/app_settings/shaders/class1/environment | |
parent | a67cf385d763325119f4d2a37beb96c9c6a80282 (diff) |
SL-9994
Make shaders use consistent naming and parameter order for transport and atmospheric helpers.
Share transport and gamma correction code where possible.
Add lots of asserts and other validation for when things don't go as planned.
Engage dumpShaderSource to get more source output with shader compilation fail.
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/environment')
3 files changed, 8 insertions, 2 deletions
diff --git a/indra/newview/app_settings/shaders/class1/environment/srgbF.glsl b/indra/newview/app_settings/shaders/class1/environment/srgbF.glsl index 835662732a..f98b3a5edf 100644 --- a/indra/newview/app_settings/shaders/class1/environment/srgbF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/srgbF.glsl @@ -60,3 +60,7 @@ vec3 linear_to_srgb(vec3 cl) } +vec3 ColorFromRadiance(vec3 radiance) +{ + return vec3(1.0) - exp(-radiance * 0.0001); +} diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl index 668a710c04..46bde7f308 100644 --- a/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl @@ -59,8 +59,10 @@ void main() vec4 outColor = mix( mix(color3, color2, alpha2), mix(color1, color0, alpha1), alphaFinal ); /// Add WL Components - outColor.rgb = atmosLighting(outColor.rgb * vertex_color.rgb); + //outColor.rgb = atmosLighting(outColor.rgb * vertex_color.rgb); + outColor.rgb = atmosLighting(outColor.rgb); + frag_color = vec4(scaleSoftClip(outColor.rgb), 1.0); } diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl index d09c5f9247..5ffe464172 100644 --- a/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl @@ -71,7 +71,7 @@ void main() /// Potentially better without it for water. pos /= pos.w; - vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0)); + vec4 color = calcLighting(pos.xyz, norm, vec4(0), vec4(1)); vertex_color = color; |