Is it Possible to Make Water More Murky?

Support for running, installing or compiling OpenMW

Before you submit a bug report for the first time, please read: Bug reporting guidelines
visvaldas
Posts: 22
Joined: 24 May 2015, 20:31

Re: Is it Possible to Make Water More Murky?

Post by visvaldas » 10 Apr 2017, 22:31

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

User avatar
Atahualpa
Posts: 745
Joined: 09 Feb 2016, 20:03

Re: Is it Possible to Make Water More Murky?

Post by Atahualpa » 11 Apr 2017, 15:24

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.

User avatar
lysol
Posts: 674
Joined: 26 Mar 2013, 01:48
Location: Sweden

Re: Is it Possible to Make Water More Murky?

Post by lysol » 15 Apr 2017, 20:38

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.
Normal mapped texture replacers, exclusive for OpenMW:
My Nexus page

visvaldas
Posts: 22
Joined: 24 May 2015, 20:31

Re: Is it Possible to Make Water More Murky?

Post by visvaldas » 08 Aug 2017, 18:35

Quick proof of concept:
screenshot374.png
screenshot373.png
screenshot372.png
screenshot371.png

User avatar
lysol
Posts: 674
Joined: 26 Mar 2013, 01:48
Location: Sweden

Re: Is it Possible to Make Water More Murky?

Post by lysol » 08 Aug 2017, 20:27

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.
Normal mapped texture replacers, exclusive for OpenMW:
My Nexus page

visvaldas
Posts: 22
Joined: 24 May 2015, 20:31

Re: Is it Possible to Make Water More Murky?

Post by visvaldas » 08 Aug 2017, 20:47

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.

Jenikk
Posts: 4
Joined: 07 Jan 2017, 09:28

Re: Is it Possible to Make Water More Murky?

Post by Jenikk » 08 Aug 2017, 21:00

Holy s***. That looks amazing! Good job visvaldas!

User avatar
lysol
Posts: 674
Joined: 26 Mar 2013, 01:48
Location: Sweden

Re: Is it Possible to Make Water More Murky?

Post by lysol » 08 Aug 2017, 21:33

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.
Normal mapped texture replacers, exclusive for OpenMW:
My Nexus page

magamo
Posts: 63
Joined: 28 May 2016, 17:28

Re: Is it Possible to Make Water More Murky?

Post by magamo » 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?

visvaldas
Posts: 22
Joined: 24 May 2015, 20:31

Re: Is it Possible to Make Water More Murky?

Post by visvaldas » 26 Aug 2017, 21:08

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest