Page 2 of 3

Re: Is it Possible to Make Water More Murky?

Posted: 10 Apr 2017, 22:31
by visvaldas
screenshot287.png
How about that?

Code: Select all

--- a/files/shaders/water_fragment.glsl
+++ b/files/shaders/water_fragment.glsl
@@ -34,7 +34,8 @@ const float SPEC_HARDNESS = 256.0;                 // specular highlights hardne
 const vec2 WIND_DIR = vec2(0.5f, -0.8f);
 const float WIND_SPEED = 0.2f;
 
-const vec3 WATER_COLOR = vec3(0.090195, 0.115685, 0.12745);
+// const vec3 WATER_COLOR = vec3(0.090195, 0.115685, 0.12745);
+const vec3 WATER_COLOR = vec3(0.25, 0.25, 0.1) * 0.8;
 
 // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -
 
@@ -174,7 +175,7 @@ void main(void)
     float waterDepth = refractionDepth - depth;
 
     if (cameraPos.z > 0.0)
-        refraction = mix(refraction, waterColor, clamp(waterDepth/VISIBILITY, 0.0, 1.0));
+        refraction = mix(refraction, waterColor, 1 - exp(-waterDepth * 0.015));
 
     gl_FragData[0].xyz = mix( mix(refraction,  scatterColour,  lightScatter),  reflection,  fresnel) + specular * gl_LightSource[0].specular.xyz;
 #else

Re: Is it Possible to Make Water More Murky?

Posted: 11 Apr 2017, 15:24
by Atahualpa
Looks nice. :)

But, first of all, we need different water types (ocean, lakes, rivers, pools) in OpenMW, plus real water geometry, plus waves and foam, plus dynamic wind and weather effects, plus... ehm. Okay, different water types would be a good start.

Re: Is it Possible to Make Water More Murky?

Posted: 15 Apr 2017, 20:38
by lysol
Atahualpa wrote: But, first of all, we need different water types (ocean, lakes, rivers, pools) in OpenMW, plus real water geometry, plus waves and foam, plus dynamic wind and weather effects, plus... ehm. Okay, different water types would be a good start.
True this.

The water color here for Balmora looks super realistic really (great job visvaldas!), but as soon as you get to the ocean, it will look wrong.

Re: Is it Possible to Make Water More Murky?

Posted: 08 Aug 2017, 18:35
by visvaldas
Quick proof of concept:
screenshot374.png
screenshot373.png
screenshot372.png
screenshot371.png

Re: Is it Possible to Make Water More Murky?

Posted: 08 Aug 2017, 20:27
by lysol
Is this a photoshopped screenshot it have you actually managed to make it look like this in-game..? Because it's brilliant and amazing and loads of other adjectives.

Re: Is it Possible to Make Water More Murky?

Posted: 08 Aug 2017, 20:47
by visvaldas
No photoshopping here :)
I'm using a texture as a map for each water color and visibility.
It would also be possible to control other parameters like wave strength(and direction?) this way.

Re: Is it Possible to Make Water More Murky?

Posted: 08 Aug 2017, 21:00
by Jenikk
Holy s***. That looks amazing! Good job visvaldas!

Re: Is it Possible to Make Water More Murky?

Posted: 08 Aug 2017, 21:33
by lysol
visvaldas wrote: 08 Aug 2017, 20:47 I'm using a texture as a map for each water color and visibility.
It would also be possible to control other parameters like wave strength(and direction?) this way.
Genius. This is so great.

Re: Is it Possible to Make Water More Murky?

Posted: 16 Aug 2017, 19:20
by magamo
Visvaldis, your work always impresses. When can you commit this (and your fog shaders) to the code base so people can start experiencing it? How close do you think you are to that point?

Re: Is it Possible to Make Water More Murky?

Posted: 26 Aug 2017, 21:08
by visvaldas
magamo wrote: 16 Aug 2017, 19:20 Visvaldis, your work always impresses. When can you commit this (and your fog shaders) to the code base so people can start experiencing it? How close do you think you are to that point?
When it's done ;)
I'm sorry, but I can't give you a more precise answer.