Water, lava, grass…

Water, lava, grass…

Postby MCMic » 26 Jan 2012, 01:16

SuperTuxKart is becoming quite pretty these times, but some elements are still ugly.
The water is one of them, it's particularly weird, flat and unrealistic!
The lava have the same problem (because it have the same look, but it should be less liquid)

Would it be possible/easy to have a nice water appearance in SuperTuxKart?
The main problem is the limit between water and ground which is highly unrealistic.
Could STK have something like this : http://youtu.be/QzVELl-ugf8 (it's made with irrlicht too)

And an other little thing that could add some beauty to STK would be some 3D grass.
Something like that : http://youtu.be/IbLm3t_dCa8

Of course these features would be deactivable in the graphic options, but it would help SuperTuxKart to have a better look.

What do you think?
User avatar
MCMic
 
Posts: 723
Joined: 05 Jan 2010, 17:40

Re: Water, lava, grass…

Postby Auria » 26 Jan 2012, 01:50

Hi,

I sure agree, especially about water. Unfortunately the one you linked to is written in HLSL (DirectX) while we use GLSL (OpenGL). So we'd need to find a GLSL water shader or write one (but frankly I personally have no idea how to write a good water shader)

3D grass could be interesting, I could check if it's hard to integrate. Unfortunately this extension you linked to has not been updated in years so I assume some work will be needed
Image
User avatar
Auria
STK Moderator
 
Posts: 2976
Joined: 07 Dec 2009, 03:52

Re: Water, lava, grass…

Postby MCMic » 26 Jan 2012, 10:00

Ok, thanks for the informations.

I'll see if I find any GLSL water shader.
User avatar
MCMic
 
Posts: 723
Joined: 05 Jan 2010, 17:40

Re: Water, lava, grass…

Postby acme_pjz » 26 Jan 2012, 10:23

Hi,

Auria {l Wrote}:So we'd need to find a GLSL water shader or write one


Check 0 A.D. it must have a nice GLSL water shader :D
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: Water, lava, grass…

Postby Funto » 27 Jan 2012, 00:50

Unfortunately, making a good water effect needs a bit more work than just applying a shader...
A possibility I know is to:
- render the scene without water to a FBO - color results go in a texture A, depth goes in a texture B
- render the scene with the camera vertically reversed to a texture C
- render a quad with a custom fragment shader that, for each pixel, samples A for refraction, B for making a fog effect (darker for deep points), and C for reflection. We generally use a Fresnel term (camera angle dependent) to determine the amount of reflection and of refraction at each point, + use a normal map and a dudv map for distortion. Finally, we need to translate the normal map and the dudv map for simulating the water current.

I have a code that does just that somewhere, but it needs to be adapted to Irrlicht, if you feel like doing it Auria :)
Funto
 
Posts: 459
Joined: 09 Dec 2009, 13:47
Location: Bordeaux, France

Re: Water, lava, grass…

Postby Auria » 27 Jan 2012, 01:52

Funto, I think we can start with something simpler ^^ Maybe just the classic moving normal map, and a bit of specular highlights and some reflections from an environment map
Image
User avatar
Auria
STK Moderator
 
Posts: 2976
Joined: 07 Dec 2009, 03:52

Re: Water, lava, grass…

Postby Funto » 28 Jan 2012, 00:11

Sure :)
Funto
 
Posts: 459
Joined: 09 Dec 2009, 13:47
Location: Bordeaux, France

Re: Water, lava, grass…

Postby Auria » 29 Jan 2012, 17:57

Hi,

I started some work on water : http://imageshack.us/photo/my-images/37/watert.jpg/
It looks much nicer animated than on a static screenshot however. It's still not as nice as in recent games but at least a good improvement
Image
User avatar
Auria
STK Moderator
 
Posts: 2976
Joined: 07 Dec 2009, 03:52

Re: Water, lava, grass…

Postby MCMic » 29 Jan 2012, 18:23

Good to hear :-)
The lava of the overworld is also really weird, while approaching it it feels like it's retracting or something like that.

(Can your work be tested in the overworld with the svn version?)
User avatar
MCMic
 
Posts: 723
Joined: 05 Jan 2010, 17:40

Re: Water, lava, grass…

Postby Auria » 29 Jan 2012, 21:23

MCMic {l Wrote}:Good to hear :-)
The lava of the overworld is also really weird, while approaching it it feels like it's retracting or something like that.

(Can your work be tested in the overworld with the svn version?)


Yes latest SVN features the new water
Image
User avatar
Auria
STK Moderator
 
Posts: 2976
Joined: 07 Dec 2009, 03:52

Re: Water, lava, grass…

Postby MCMic » 30 Jan 2012, 15:15

I've been able to try it.
The main problem is still the water edge…
I really don't know how to fix tart but it's highly weird looking, especially with its animation.
The water should have little opacity near the edge, we should see some gradient of opacity or something like this.
User avatar
MCMic
 
Posts: 723
Joined: 05 Jan 2010, 17:40

Re: Water, lava, grass…

Postby Auria » 30 Jan 2012, 16:47

agreed, there is still room for improvement
Image
User avatar
Auria
STK Moderator
 
Posts: 2976
Joined: 07 Dec 2009, 03:52

Who is online

Users browsing this forum: No registered users and 1 guest