a simple way to enhance water in the game engine using UPBGE and community patch

I know there are diffrent ways to make water with the game engine. After I searced some time i noticed UPBGE with the community patch was already able to to use reatime reflection and refraction. However this can be improved be using the depth transparency and the fresnel node input. Instead of using one material I used one for the reflection an one for the refraction (the one that conains the deph transparency). While reflection uses mix blend mode refraction uses multiply. Both materials contain four normal maps that get offst over time all in different directions this creates the impression of still (not flowing but animated waves) water in a lake. I think the results are quite amazing. Dont forget to play with the colorinfluence of the texture to get the best results. The refraction ( with color 67745F) has 0.79 color influence and reflection (with color 888888) 1.00 in my case. What do you think? I hope this helps someone.

*I can’t figure out how to remove or move this thread. I guess it would fit more to the game engine topic:(

Attachments



2 Likes

Moved from “Artwork > Blender Tests” to “Game Engine > Game Engine Support and Discussion”

It looks great! Thanks for sharing :slight_smile:

post a .blend oi?

or one at blendswap and link it here?

Well I made some improvements already, it is not as simple anymore. The result looks a little better now but I am still testing. However if you like to see the result be free to use this. Now low water has refraction and the sky colored edges are cut by an ‘alpha blended border’. I am pretty sure it has quite some impact on render time, but it still runs at 60 fps on my PC. Remember the file only works with UPBGE with community patch. If you wonder about the complex structure of the nodes. The idea was to use the alpha depth to darken the color of the refraction result. It would be nice to adjust the amount of refraction by it too. The last material node is needed to make the materials work correct with fog for example. If it was not there blend modes calculate the fog into the own colors and the lake colors would behave strangely. I needed to remove some objects and some textures to send the blend, but here it is.

*Sry for that, after clearing up most data I forgot to pack again. It took some time, but I updated the .blend file. All textures except the normal are low resolution. The ground now should have some mossy texture and the water should have normals :slight_smile:

Attachments


Water&LowResTX.blend (4.83 MB)

1 Like

@anothername!
Please attack textures for your file.

I updated the file in my previous post. All textures are made by me so they are free for any use. Sorry again!

@anothername! ​Thanks.

OK, it is not that simple anymore, what I don’t get is: why the water color of the refraction, if multiplied, looses its displace effect. That is the reason for the strange node setup and the useless node too, I was just trying. I wonder if the color data of a material does not only contain the materials displaced colors, but the UV or normals data as some invisible attachment that is still affected by the color multiply. The multiply would ‘darken’ the ‘displaced’ UV coordinates too. Of course I am just guessing.

hey btw, I noticed that if you have a blender 2.77 installed too, you can import a plan with an animated normal map, then animate the texture in the UV image editor’s game section, save it, then import it into UPBGE or later versions of BGE and it works!
so this way you can also get real moving waves too