diff options
author | Graham Linden <graham@lindenlab.com> | 2018-06-12 18:42:07 +0100 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2018-06-12 18:42:07 +0100 |
commit | 67ab0084f87c40bf31d7fadded55cc9ea6299ca2 (patch) | |
tree | 1d8119cd8d0b6078724a8128da37c15321a9f703 /indra/newview/app_settings/shaders/class1/deferred/materialF.glsl | |
parent | 327ded51298599a0057c4a3baf388956ecfed2e5 (diff) |
Fix env panel forward action.
Make env panel update environment when jumping frame to frame.
Add separate funcs for sun/moon vectors in various coord systems.
Make haze glow only pay attention to sun (i.e. fix sun glow when moon is near horizon in daytime).
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/materialF.glsl')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/materialF.glsl | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl index a90e433622..4dc15dbc89 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl @@ -98,6 +98,7 @@ uniform mat3 env_mat; uniform mat3 ssao_effect_mat; uniform vec3 sun_dir; +uniform vec3 moon_dir; VARYING vec2 vary_fragcoord; VARYING vec3 vary_position; @@ -388,7 +389,9 @@ void main() vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); - float da =dot(norm.xyz, sun_dir.xyz); + float da_sun =dot(norm.xyz, sun_dir.xyz); + float da_moon =dot(norm.xyz, moon_dir.xyz); + float da = max(da_sun, da_moon); float final_da = da; final_da = min(final_da, shadow); @@ -418,7 +421,10 @@ void main() // the old infinite-sky shiny reflection // - float sa = dot(refnormpersp, sun_dir.xyz); + float sa_sun = dot(refnormpersp, sun_dir.xyz); + float sa_moon = dot(refnormpersp, moon_dir.xyz); + float sa = max(sa_sun, sa_moon); + vec3 dumbshiny = sunlit*shadow*(texture2D(lightFunc, vec2(sa, spec.a)).r); // add the two types of shiny together |