mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-29 18:32:36 +00:00
Merge branch 'waterscatter' into 'master'
Use sun visibility for sunlight scattering (bug #7309) Closes #7309 See merge request OpenMW/openmw!3478
This commit is contained in:
commit
c53abd870b
@ -73,6 +73,7 @@
|
||||
Bug #7292: Weather settings for disabling or enabling snow and rain ripples don't work
|
||||
Bug #7298: Water ripples from projectiles sometimes are not spawned
|
||||
Bug #7307: Alchemy "Magic Effect" search string does not match on tool tip for effects related to attributes
|
||||
Bug #7309: Sunlight scattering is visible in inappropriate situations
|
||||
Bug #7322: Shadows don't cover groundcover depending on the view angle and perspective with compute scene bounds = primitives
|
||||
Bug #7354: Disabling post processing in-game causes a crash
|
||||
Bug #7364: Post processing is not reflected in savegame previews
|
||||
|
@ -174,7 +174,7 @@ void main(void)
|
||||
vec3 waterColor = WATER_COLOR * sunFade;
|
||||
|
||||
vec4 sunSpec = lcalcSpecular(0);
|
||||
// alpha component is sun visibility; we want to start fading specularity when visibility is low
|
||||
// alpha component is sun visibility; we want to start fading lighting effects when visibility is low
|
||||
sunSpec.a = min(1.0, sunSpec.a / SUN_SPEC_FADING_THRESHOLD);
|
||||
|
||||
// artificial specularity to make rain ripples more noticeable
|
||||
@ -203,7 +203,7 @@ void main(void)
|
||||
float sunHeight = lVec.z;
|
||||
vec3 scatterColour = mix(SCATTER_COLOUR*vec3(1.0,0.4,0.0), SCATTER_COLOUR, clamp(1.0-exp(-sunHeight*SUN_EXT), 0.0, 1.0));
|
||||
vec3 lR = reflect(lVec, lNormal);
|
||||
float lightScatter = clamp(dot(lVec,lNormal)*0.7+0.3, 0.0, 1.0) * clamp(dot(lR, vVec)*2.0-1.2, 0.0, 1.0) * SCATTER_AMOUNT * sunFade * clamp(1.0-exp(-sunHeight), 0.0, 1.0);
|
||||
float lightScatter = clamp(dot(lVec,lNormal)*0.7+0.3, 0.0, 1.0) * clamp(dot(lR, vVec)*2.0-1.2, 0.0, 1.0) * SCATTER_AMOUNT * sunFade * sunSpec.a * clamp(1.0-exp(-sunHeight), 0.0, 1.0);
|
||||
gl_FragData[0].xyz = mix(mix(refraction, scatterColour, lightScatter), reflection, fresnel) + specular * sunSpec.rgb * sunSpec.a + rainSpecular;
|
||||
gl_FragData[0].w = 1.0;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user