Board index FlightGear Development Effects and shaders

Water shader

An exciting "new" option in FlightGear, that includes reflections, lightmaps, the particle system etc.. A lot is yet to be discovered/implemented!

Water shader

Postby gral » Sat Sep 04, 2010 11:07 am

Hello all

I am currently working on an improved water shader (but I need some testers with nvidia graphic cards now). It is not finished yet, sunlight comes from wrong direction :wink: and diffuse is still missing. The former water shader does a really good job with sunlight, but I wanted to have more 'water structure' or moving waves instead of a darkness and moving dust from far, more colors, deepness, refraction, but sunlight reflection still included of course. It seems to work here but could someone with nvidia (GL 2.0/GLSL 1.2, recent SG/FG/fgdata GIT only) send me a PM (for a download link) to check?

Thanks, gral

First impression, lake of Konstanz (swiss part):
Image
gral
 
Posts: 325
Joined: Mon Nov 16, 2009 1:03 pm
Location: Zurich (Switzerland)
Callsign: HB-GRAL
Version: GIT

Re: Water shader

Postby Oscar » Sat Sep 04, 2010 1:38 pm

That looks very cool! But I don't really know if I have the right graphics card for testing it (dunno what GL and GLSL or whatever is). I have an nvidia GeForce 9400, on a Mac Mini. I run the normal 2.0 and the Mac GIT release.
User avatar
Oscar
 
Posts: 407
Joined: Sat Sep 05, 2009 1:12 pm
Location: The Netherlands
Callsign: PH-OMB/Oscar
Version: 2pt6
OS: Mac OS X

Re: Water shader

Postby ot-666 » Sat Sep 04, 2010 3:09 pm

As soon you need an ATI (hd 5850 up to OpenGL 4.0.10151 GLSL 4.00) test subject I am up for his.

The water improvement you work on already looks very promising. Is there a way to create a reaction to the coastline or a if used with a river or lake a reaction to the surrounding area? Would be a need effect to have some slip rock or sand at the river bank.

Oliver
Callsign: ot-666
Working on LOWI and other stuff - Custom Scenery Overlay Repo: http://gitorious.org/fgfs-custom-scenery/custom-scenery-overlay/
VMX22 - Osprey... sometimes in 2014
ot-666
 
Posts: 746
Joined: Sun Nov 08, 2009 5:14 pm
Location: Germany, Konstanz
Callsign: ot-666
IRC name: ot666
Version: GIT
OS: win7 64bit

Re: Water shader

Postby gral » Sat Sep 04, 2010 5:35 pm

No sandbanks, but I recently got some oil ?! I have to clean up a bit.

Image

btw. you will not need openGL >= 2.0 and GLSL >= 1.2, but I need your machine, ot-666 :wink:
gral
 
Posts: 325
Joined: Mon Nov 16, 2009 1:03 pm
Location: Zurich (Switzerland)
Callsign: HB-GRAL
Version: GIT

Re: Water shader

Postby statto » Sat Sep 04, 2010 5:59 pm

That looks really good as a starting point!

The sun usually reflects on water more like a column of light, though (less scattered, more focused), especially when you're looking toward the sun.

Also, colours tend to play off each other - for instance, if you look east in the sky in the afternoon, the angle of the sun will cause water close to you to look different than the water farther away.

I don't know if this helps at all, though.
Custom Scenery available from http://www.stattosoftware.com/flightgear
statto
 
Posts: 1859
Joined: Fri Jan 25, 2008 9:57 pm

Re: Water shader

Postby grtux » Sun Sep 05, 2010 11:40 am

Hi, Gral

Your project regarding the Water is very interesting.
Right now we don' t have any diff in between
<name>Lake</name>
<name>Pond</name>
<name>Reservoir</name>
<name>Stream</name>
<name>Canal</name>
<name>Lagoon</name>
<name>Saline</name>

It would be nice to process each one with a specific texture/effect.

Thanks
Gérard
g.robin
LFMO
User avatar
grtux
 
Posts: 432
Joined: Thu Dec 14, 2006 4:19 pm
Location: Provence France

Re: Water shader

Postby simbabeat » Mon Sep 06, 2010 4:49 am

My suggestions from grtux's suggestions:

<name>Lake</name>
Slightly dirty and a bit transparent with lots of waves in DIFFERENT directions because of recreational boat traffic.

<name>Pond</name>
Dirty??

<name>Reservoir</name>
Blue

<name>Stream</name>
Dirty with big waves.

<name>Lagoon</name>
Green?


Random yes but do you get my drift?

Cheers
User avatar
simbabeat
 
Posts: 3434
Joined: Sat Sep 12, 2009 12:19 am

Re: Water shader

Postby gral » Mon Sep 06, 2010 8:24 am

Meantime some other shader developers checked the new water shader. Unfortunately I have to say there are wrong colours on other cards, wrong math in code and other carbage. Will take some time to come back, thanks for all the feedback.

Cheers, gral
gral
 
Posts: 325
Joined: Mon Nov 16, 2009 1:03 pm
Location: Zurich (Switzerland)
Callsign: HB-GRAL
Version: GIT

Re: Water shader

Postby gral » Tue Sep 07, 2010 9:42 am

I have some problems with color reference with my card. On other cards the effect became too cyan. As first step I tried to fix this and I need some other 'color' testers now. You can download the new effect here. You will need recent GIT version to test it and please do not replace the files before you have a backup of the old ones. Please post some screens here (max. 800x600 px), especially with nvidia cards/drivers and different daytime and views, this will help me to improve the shader. Thanks!

Installing:
- water.eff goes into fgdata/Effects (replacing the old file)
- water.frag/water.vert goes to fgdata/Shaders (replacing the old files)
- folder 'Water' goes to fgdata/Textures (this is a new image folder in Textures, no replace)

Thanks for your help, gral

Link to the files: http://tinyurl.com/2w8b898
gral
 
Posts: 325
Joined: Mon Nov 16, 2009 1:03 pm
Location: Zurich (Switzerland)
Callsign: HB-GRAL
Version: GIT

Re: Water shader

Postby Intel-Qube » Tue Sep 07, 2010 4:46 pm

I have an nVidia gt 220m, I'll be happy to test your [beautiful] shaders! :wink:
Fav. Jet: [Self-Designed] X-29
Fav. Plane: de Havilland DHC6
Fav. Airports: KEGE, KDEN, KFCS, KSFO, XBEL
"My mind is like a sponge, it absorbs knowledge." "That's my line." "Yeah, well I absorbed it." -Greg Sanders to Gil Grissom
User avatar
Intel-Qube
 
Posts: 207
Joined: Wed Sep 09, 2009 3:42 am
Location: Colorado, United States
Callsign: Intel-Q
Version: GIT
OS: Win 7 64-bit

Re: Water shader

Postby Gijs » Tue Sep 07, 2010 5:00 pm

NVIDIA Geforce Go 7300

First impression: WOW
Second impression: still WOW, very interesting and lots of potential, but it ain't finished yet. When you move your "head" around or up/down for example, the reflections change unrealistic. Please note that I have limited beach experience, and even less from-aircraft experience, so I'm not sure if my opinion is that valuable...

IMO it looked quite weird on several occasions during my test. have tried to capture this in my screenshots.

Image
Image
Image
Image
Image
Image
Image
Image

Some of these are beatifull water surfaces though. It makes flying over oceans a lot less boring than before! :D
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400, DC-2, F-117, Jetman, L1011-500
FlightGear Liveries
User avatar
Gijs
Moderator
 
Posts: 8695
Joined: Tue Jul 03, 2007 2:55 pm
Location: Amsterdam/Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 7

Re: Water shader

Postby gral » Tue Sep 07, 2010 5:22 pm

Gijs wrote:NVIDIA Geforce Go 7300
When you move your "head" around or up/down for example, the reflections change unrealistic. Please note that I have limited beach experience, and even less from-aircraft experience, so I'm not sure if my opinion is that valuable...


Thanks for your feedback. It is not finished (i.e. the view direction and reflection) but I am happy to see that you get the same colors!
-gral
gral
 
Posts: 325
Joined: Mon Nov 16, 2009 1:03 pm
Location: Zurich (Switzerland)
Callsign: HB-GRAL
Version: GIT

Re: Water shader

Postby Hooray » Tue Sep 07, 2010 5:27 pm

Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
Nasal | Projects | Core development |
Programming resources
Hooray
 
Posts: 6609
Joined: Tue Mar 25, 2008 8:40 am

Re: Water shader

Postby gral » Tue Sep 07, 2010 5:54 pm

Hooray wrote:I am not sure if you have looked into other GLSL based approaches to do ocean rendering, but you may want to check out some of these links:

http://simon.auner.se/files/TNM084_Report_simau500.pdf
http://kineme.net/forum/Discussion/Deve ... ageTexture
http://kineme.net/Discussion/Developing ... ceanShader
http://blenderartists.org/forum/showthread.php?t=93658


Thanks for the links, Hooray.
-gral

btw. I will change the name from water.eff to lake.eff ASAP ;-)
gral
 
Posts: 325
Joined: Mon Nov 16, 2009 1:03 pm
Location: Zurich (Switzerland)
Callsign: HB-GRAL
Version: GIT

Re: Water shader

Postby Oscar » Tue Sep 07, 2010 8:21 pm

That looks very nice! Just did a small flight from KSFO and here are some shots I got:
ImageImageImageImageImage
(click for bigger images)

This is very cool already!

Maybe you could do something like a reflection image of clouds in it? I have no idea if it's possible or how hard it is, but if it's do-able, it would be very cool!
User avatar
Oscar
 
Posts: 407
Joined: Sat Sep 05, 2009 1:12 pm
Location: The Netherlands
Callsign: PH-OMB/Oscar
Version: 2pt6
OS: Mac OS X

Next

Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 2 guests