Board index FlightGear Development Effects and shaders

Terrain self shadowing

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

Re: What/Where did you fly today? - Part 2

Postby chris_blues » Wed Apr 10, 2013 12:02 am

<OT>
I'm sorry to break the rules about image size; I'm sorry, this is not FG but reality; I'm sorry this is not me flying around there, but I find the picture most beautiful and I wish, I would have been the one piloting the aircraft around Greenland to get these kind of impressions!
This pic has been shot by NASA (URL=http://www.nasa.gov/mission_pages/icebridge/news/spr13/index.html)
I wish, someday we get these kind of landscapes in FG!

Anyway, I hope you all can forgive me and can enjoy this astonishing view (at least in my opinion...)
Image
</OT> Back to topic!!! :)

EDIT:
Coming to think about it, I guess this would have been better posted in "real aviation"... sorry again!
Don't hesitate to let me know if I'm incorrect or just annoying! As long as you do it gently! :)
Debian testing 64bit - Athlon II 2x2.6GHz - 8GB RAM - GeForce GTS 450
Citation II
User avatar
chris_blues
 
Posts: 1533
Joined: Mon May 03, 2010 1:30 pm
Location: claws of real life
Callsign: chris_blues
Version: GIT
OS: Debian 8 64

Re: What/Where did you fly today? - Part 2

Postby Thorsten » Wed Apr 10, 2013 5:50 am

I wish, someday we get these kind of landscapes in FG!


Image
Image

We pretty much have it all... High terrain resolution mountains are coming out quite nicely, procedural snow gets down to meter-sized patches and 10-cm scale ripples for lighting, and adding drift ice to water is also on the way.
Thorsten
 
Posts: 10844
Joined: Mon Nov 02, 2009 8:33 am

Re: What/Where did you fly today? - Part 2

Postby Hooray » Wed Apr 10, 2013 5:58 am

I wish, someday we get these kind of landscapes in FG!

tend to agree with Thorsten, we seem to be half way there already - matching the appearance of the real picture would seem to be a matter of 1) self-shadowing terrain, 2) water/ice reflections, 3) pack ice with different transparency settings, 4) having a mirroring effect for water/ice.
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 !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11326
Joined: Tue Mar 25, 2008 8:40 am

Re: What/Where did you fly today? - Part 2

Postby chris_blues » Wed Apr 10, 2013 8:12 am

Thorsten, you are killing me! :D

How do you do that? Everytime, I wish for something, you already have it, but I don't. lol
No, seriously, am I doing sth wrong with my shader settings, or why don't I get these kind of pictures? (Have them all maxed out, skydome scattering on, local weather on...)

(this floating ice looks incredible!!)
Don't hesitate to let me know if I'm incorrect or just annoying! As long as you do it gently! :)
Debian testing 64bit - Athlon II 2x2.6GHz - 8GB RAM - GeForce GTS 450
Citation II
User avatar
chris_blues
 
Posts: 1533
Joined: Mon May 03, 2010 1:30 pm
Location: claws of real life
Callsign: chris_blues
Version: GIT
OS: Debian 8 64

Re: What/Where did you fly today? - Part 2

Postby Thorsten » Wed Apr 10, 2013 10:25 am

No, seriously, am I doing sth wrong with my shader settings, or why don't I get these kind of pictures?


I develop these things in the first place, so they tend to be on my harddisk a while before they appear on GIT and well before they appear in a release. The ice isn't anywhere out yet - I am still tinkering with a revised water shader, in particular I am thinking about making a land-sea transition work.

Also, I tend to stay informed about custom scenery and often use that (the snow-covered mountains are the French Alps, and you need decent terrain resolution to get the nice patterns of snow and rock alternating - the drift ice is actually Greenland, and it doesn't have such impressive mountains because the terrain resolution isn't so good).

1) self-shadowing terrain


In the event, probably dialling down ambient light a bit might work as well...

3) pack ice with different transparency settings


That's not a bad idea and should be easy to do.
Thorsten
 
Posts: 10844
Joined: Mon Nov 02, 2009 8:33 am

Terrain self shadowing

Postby Hooray » Wed Apr 10, 2013 5:18 pm

Thorsten wrote in Wed Apr 10, 2013 10:25 am:
1) self-shadowing terrain

In the event, probably dialling down ambient light a bit might work as well...


What about borrowing some ideas from the way "ridge lift" was implemented: determining the the direction to the sun from the current viewpoint (instead of the wind direction), and then sampling the terrain for a corridor of terrain to determine its slope, in order to come up with "shadowiness" based on a bunch of slopes, would that work in your opinion ?
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 !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11326
Joined: Tue Mar 25, 2008 8:40 am

Re: What/Where did you fly today? - Part 2

Postby Thorsten » Wed Apr 10, 2013 6:14 pm

No. You need ridge lift for a single position (the aircraft position). You need shadow computations for all pixels you see, i.e. the computational demand is about a million times more, and they can't easily be done in the shaders, as vertex and pixel shaders only have local information. So the fast way is to shade based on normal vector and sun position, and the more detailed way is to use the shadow maps Rembrandt uses (or, if you really have framerate to burn, use a geometry shader to extrude geometry along the light vector and use that to define shadow volumes).
Thorsten
 
Posts: 10844
Joined: Mon Nov 02, 2009 8:33 am

Terrain Self Shadowing

Postby Hooray » Thu Apr 11, 2013 2:24 am

Outerra does seem to solve the self-shadowing terrain problem fairly well, while still supporting JSBSim, i.e. potentially acting as a flight simulator, here are some screen shots from a year ago, i.e. 04/2012:

Image
Image

http://www.outerra.com/forum/index.php?topic=986.0

And it seems there are several competing approaches, including a "semi-realtime" approach which pre-computes cached shadow maps (i.e. making a space-time tradeoff): http://vterrain.org/Performance/lighting.html

OTOH, I do agree that this seems to be mostly relevant in the context of Rembrandt.
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 !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11326
Joined: Tue Mar 25, 2008 8:40 am

Re: What/Where did you fly today? - Part 2

Postby Thorsten » Thu Apr 11, 2013 5:59 am

Outerra does seem to solve the self-shadowing terrain problem fairly well, while still supporting JSBSim


Well, if we could re-design the terrain rendering from scratch easily... *sigh*

Rembrandt does solve the terrain self-shadowing in real time as far as I know. Terrain self-shading beyond the local surface normal version is pretty rare by the way - most slopes are less than 30 deg, so whenever the sun is higher than 30 deg you don't get to see it - it's a low-sun, cloudless sky, steep terrain only phenomenon. The Outerra thing could well be a local shading only - I can probably get you similar impressions dialling ambient light.

The most pronounced shadows in reality are cloud shadows on the ground.
Thorsten
 
Posts: 10844
Joined: Mon Nov 02, 2009 8:33 am

Re: What/Where did you fly today? - Part 2

Postby Thorsten » Thu Apr 11, 2013 3:54 pm

Illustrating my point about what a local terrain self-shading model (which we have already!) can do - in the following, I simply changed the balance between ambient and diffuse lighting in the shader.

Current:

Image

Enhanced shadows:

Image

Current:

Image

Enhanced shadows:

Image

(Given a higher resolution terrain mesh and better and higher resolution tree textures, we'd not look so different from Outerra here... But since it's a flight simulation, close-up shots are not really central to the whole affair)
Thorsten
 
Posts: 10844
Joined: Mon Nov 02, 2009 8:33 am

Re: What/Where did you fly today? - Part 2

Postby Martien van der P. » Thu Apr 11, 2013 4:43 pm

Why all those scenery pictures belongs it to this topic? :) :) :) :)
User avatar
Martien van der P.
 
Posts: 323
Joined: Fri Dec 14, 2012 4:09 pm
Location: The Netherlands
Callsign: MV-DP
Version: 2018.3.2
OS: Windows 7

Re: What/Where did you fly today? - Part 2

Postby Thorsten » Thu Apr 11, 2013 6:05 pm

It's called 'having a discussion'. :D Which is, somehow, the whole point about a forum. Threads can be sorted later by a mod, but I don't see the point of not talking about interesting ideas because they don't mesh with the thread title.
Thorsten
 
Posts: 10844
Joined: Mon Nov 02, 2009 8:33 am

Re: What/Where did you fly today? - Part 2

Postby Hooray » Thu Apr 11, 2013 11:48 pm

Agreed with Thorsten, we can look at splitting the thread later on - and those screen shots are fantastic, I only just looked up some wiki screen shots, such as this one:

Image

But you have already made your point in a pretty compelling fashion, once again! :D

BTW: How do you usually create those nice "PRE/POST-Thorsten" screen shots ? Do you save the coordinates/view settings separately for each screen shot to easily recreate those at a later time ?

Just asking because such a feature would obviously be pretty useful to show changes , so having an option to dump the current position and view settings, and easily re-create those using a Nasal script would indeed seem very useful - and JPEG images even support EXIF meta data to include pretty much arbitrary data.

Or are you using the replay/flight recorder subsystem for that ?
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 !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11326
Joined: Tue Mar 25, 2008 8:40 am

Re: What/Where did you fly today? - Part 2

Postby Philosopher » Fri Apr 12, 2013 12:05 am

I'm betting on a property toggle -- clouds are in the same place ;).
Thanks,
Philosopher
(inactive but lurking occasionally...)
Philosopher
 
Posts: 1590
Joined: Sun Aug 12, 2012 6:29 pm
Location: Stuck in my head...
Callsign: AFTI
Version: Git
OS: Mac OS X 10.7.5

Re: What/Where did you fly today? - Part 2

Postby Hooray » Fri Apr 12, 2013 1:24 am

right, in this case certainly - but Thorsten tends to post comparison screen shots that are sometimes weeks apart, so there must be something else going on ? :D
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 !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11326
Joined: Tue Mar 25, 2008 8:40 am

Next

Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 1 guest