Board index FlightGear Development New features

3d volumetric airport grass

Discussion and requests for new features. Please note that FlightGear developers are volunteers and may or may not be able to consider these requests.

3d volumetric airport grass

Postby lomar » Sat Jul 26, 2014 11:40 pm

well, i am thinking about start developing a volumetric airport grass model to FG, wich could be used as a part of the random trees shader.
i think that it could be great in therms of visual, and also not too fps demanding.
so, what do you think? anione here supports the idea?
lomar
 
Posts: 479
Joined: Mon Jun 30, 2014 2:38 am
Location: Rio de Janeiro, Brazil
Callsign: lomar
Version: nightly
OS: win 10

Re: 3d volumetric airport grass

Postby Hooray » Sat Jul 26, 2014 11:51 pm

many helicopter guys to support this idea, because that's the sort of visual feedback needed for low-level/ground ops, such as hovering etc - you may want to run a forum search, I think we had ~5-10 discussions about this.

And this may also help: http://wiki.flightgear.org/GLSL_Shader_ ... Vegetation

Subject: Outerra Engine
jack wrote:Or the grass bending down and the dirt flying up when you hover over in a helicopter... :P

Then again, having grass in general is yet to be done... :?


Subject: Airport Textures...
f-ojac wrote:I agree with Fred: I would like to see the grass moving, and with a special blowing effect when my Cessna is taking off ;-)



Subject: What effects are we missing?
Hooray wrote:
We could probably have more environment - terrain/model interactions - the flag shader is an example for something moving in the wind, presumably we could also have something which looks like grass in the wind, or think rain,...


FWIW, I do like the idea of having a more-complete terrain interaction framework implemented in FG, so that artwork contributors could for example help by providing textures for different vegetation types without having to know too much about programming or GLSL in particular.

Terrain interaction is also important for certain ground maneuvers in real life (especially for helicopter pilots, i.e. takeoff/landing, hovering), i.e. having visuel cues (moving grass/snow/sand or water) would be relevant - and would even allow implementing whiteout, without resorting to a visual hack.

Specifically, I am thinking in terms of not only increasing realism, but also in terms of novel features that would help set FG apart from its commercial/proprietary counterparts.

That said, such a feature would obviously require some concept of "turbulence" and distribution of it - but on the other hand, I'm talking to the "weather guy", right? :lol:



Subject: Landscape Art
Thorsten wrote:
The second one makes me want to go for a drive low flight in the countryside.


And you can even see the wind moving the grass (although I'm not completely happy with the effect yet...) :D . Flying with a helicopter and landing somewhere in the terrain is actually pretty nice now, there's lots of ground details which you really only get to see that way (or with the cars of course).


Subject: Landscape Art
Thorsten wrote:
Is that a shader in a similar way to the water shader, but perhaps with slightly different wave patterns?


It's three interfering sine waves passed through a quadratic filter to give the appearance of gusts which then fade back to nothing, with a linear component superimposed for strong winds so that you get the impression of a flow of leaves and debris across the ground if there is a storm - much less regular than the water shader.

Code: Select all
// Wind motion of the overlay noise simulating movement of vegetation and loose
debris

vec2 windPos;

if (wind_effects > 1)
        {
        float windSpeed = length(vec2 (WindE,WindN)) /3.0480;
        // interfering sine wave wind pattern
        float sineTerm = sin(0.35 * windSpeed * osg_SimulationTime + 0.05 * (raw
Pos.x + rawPos.y));
        sineTerm = sineTerm + sin(0.3 * windSpeed * osg_SimulationTime + 0.04 *
(rawPos.x + rawPos.y));
        sineTerm = sineTerm + sin(0.22 * windSpeed * osg_SimulationTime + 0.05 *
 (rawPos.x + rawPos.y));
        sineTerm = sineTerm/3.0;
        // non-linear amplification to simulate gusts
        sineTerm = sineTerm * sineTerm;//smoothstep(0.2, 1.0, sineTerm);

        // wind starts moving dust and leaves at around 8 m/s
        float timeArg = 0.01 * osg_SimulationTime * windSpeed * smoothstep(8.0,
15.0, windSpeed);
        timeArg = timeArg + 0.02 * sineTerm;

        windPos = vec2 (rawPos.x + WindN * timeArg, rawPos.y +  WindE * timeArg)
;
        }
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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: 3d volumetric airport grass

Postby lomar » Sun Sep 07, 2014 3:33 am

T4T appears to have a grass effect, but i don't think they would share with us...
and a question:why are there two "materials.xml" at the materials folder?
and could someone help me with this development?
lomar
 
Posts: 479
Joined: Mon Jun 30, 2014 2:38 am
Location: Rio de Janeiro, Brazil
Callsign: lomar
Version: nightly
OS: win 10

Re: 3d volumetric airport grass

Postby stuart » Mon Sep 08, 2014 1:32 pm

Hi lomar,

The different materials.xml files reflect different texture sets. We have at present, two global textures sets (one with .png images, one with .dds) and a "regions" one, which defines different textures and effects depending on where you are in the world.

The current development stream includes a new materials.xml format which makes a lot of this easier. I'd strongly recommend developing any new feature against that rather than the V3.2.0 (or indeed the V3.0.0) release.

As Hooray points out above, it should be straightforward to create grass based on the tree shader, and you could probably prototype just by modifying the materials.xml parameters to create many more smaller trees (see Docs/README.materials for what the parameters are).

However, the trees have a memory footprint. This is fairly small, but obviously there are many more blades of grass than trees! While I haven't done the sums, I'm fairly confident you couldn't use the same approach for grass. Instead you'd probably want to do something much more clever. For example, you might define an area (say 50mx50m) of defined volumetric grass, and then apply this just to the scenery underneath the aircraft, clipping to the scenery triangle edges, and using a translation on some wind/height function so that as you moved around, the apparent grass moved passed you.

Have fun!

-Stuart
G-MWLX
User avatar
stuart
Moderator
 
Posts: 1629
Joined: Wed Nov 29, 2006 10:56 am
Location: Edinburgh
Callsign: G-MWLX

Re: 3d volumetric airport grass

Postby Thorsten » Wed Nov 26, 2014 12:39 pm

While I haven't done the sums, I'm fairly confident you couldn't use the same approach for grass.


You sort of can - just set the tree range to a really low value for the material (say 200 m) and use a high vegetation density, and voila:

Image

Image

Any gimp artists /wizards volunteering for better texture work? This is just gobbled together from taking what google found me for a public domain grass blade texture.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: 3d volumetric airport grass

Postby Catalanoic » Wed Nov 26, 2014 3:05 pm

good work!
User avatar
Catalanoic
 
Posts: 1099
Joined: Mon Mar 05, 2012 1:33 am
Location: Barcelona (LEBL)
Callsign: Catalanoic
Version: 2017.3
OS: Lubuntu/Windows 7

Re: 3d volumetric airport grass

Postby wlbragg » Wed Nov 26, 2014 4:35 pm

Thorsten,

Using this technique you don't get movement in the vegetation, your just showing how you could get the grass down?
Still to come would be shader or mechanism to move the grass around?
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7587
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: 3d volumetric airport grass

Postby Thorsten » Wed Nov 26, 2014 6:29 pm

Of course it moves - technically it's a tree, so it's running over the tree shader which has wind movement. The dynamics might be wrong, but that's easily cured since we know the length.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: 3d volumetric airport grass

Postby wlbragg » Wed Nov 26, 2014 6:35 pm

Of course it moves - technically it's a tree

Sorry, I meant movement from Helicopter rotor wash?

The above info is just a method already available to allow for helicopter rotor wash to effect grass, the wash data still needs to be computed and applied to the grass?

The dynamics might be wrong

Right, we would need down wash not side wind...
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7587
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: 3d volumetric airport grass

Postby Hooray » Wed Nov 26, 2014 6:43 pm

you may want to run a forum search: we've had a few discussions about modeling downwash even without any FDM-level support, i.e. by using a few 3D positions for different kinds of "turbulence discs" with a configurable orientation, vector/direction, diameter and strength. That info would then be fed back to the shaders to "animate" the vegetation.
Obviously, that's still pretty simplistic and doesn't take terrain interactions into account - but it would certainly be a nice proof-of-concept - even though our helicopter folks would surely prefer having a more "proper" solution in place...
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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: 3d volumetric airport grass

Postby Thorsten » Wed Nov 26, 2014 7:28 pm

Sorry, I meant movement from Helicopter rotor wash?


Tchnically, we just pass the center of the downstream to the shader, and perhaps a strength. In practice, yet another performance hit, because it needs to be evaluated for every tree vertex in the scene.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: 3d volumetric airport grass

Postby Bomber » Thu Nov 27, 2014 11:42 pm

lomar wrote in Sun Sep 07, 2014 3:33 am:T4T appears to have a grass effect, but i don't think they would share with us...
and a question:why are there two "materials.xml" at the materials folder?
and could someone help me with this development?


Wow just seen this.... No we don't, and if we did we'd share.... Like we've shared all our FG development.
"If anyone ever tells you anything about an aeroplane which is so bloody complicated you can't understand it, take it from me - it's all balls" - R J Mitchel
Bomber
 
Posts: 1933
Joined: Fri Dec 14, 2007 8:06 pm
OS: Windows XP and 10

Re: 3d volumetric airport grass

Postby tigert » Tue Dec 16, 2014 10:41 am

I posted to flightgear-devel list with this screenshot, but I guess we might have a different audience here, so posting here as well:

The effect can actually be quite striking. Note how the asphalt edge is obscured by the grass:
https://dl.dropboxusercontent.com/u/273 ... en-245.png
That small detail seems to trigger some "it looks real" buttons in the brain, at least for me.

Edit: actually, would it be possible to create a placement map for the "trees" (grass) on top of the ground texture? That way you could have
grainy and gray gravel patches that have the bunch of grass over more green/mossy texture pixels in between - could look pretty realistic and nicely reduce the total number of objects..

//T
tigert
 
Posts: 106
Joined: Sat Nov 08, 2014 10:57 am

Re: 3d volumetric airport grass

Postby Thorsten » Tue Dec 16, 2014 12:47 pm

Edit: actually, would it be possible to create a placement map for the "trees" (grass) on top of the ground texture? That way you could have
grainy and gray gravel patches that have the bunch of grass over more green/mossy texture pixels in between - could look pretty realistic and nicely reduce the total number of objects..


I guess you don't fly much in the US Southwest? Airport keep is rendered as gravel there with just a few patches of green - look into the regional definitions and enjoy tinkering :-)
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: 3d volumetric airport grass

Postby Johan G » Tue Dec 16, 2014 7:14 pm

tigert wrote in Tue Dec 16, 2014 10:41 am:The effect can actually be quite striking. Note how the asphalt edge is obscured by the grass:
https://dl.dropboxusercontent.com/u/273 ... en-245.png
That small detail seems to trigger some "it looks real" buttons in the brain, at least for me.

It sure does for me as well. :D
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Some YouTube videos
Johan G
Moderator
 
Posts: 6629
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

Next

Return to New features

Who is online

Users browsing this forum: josefjkalicun and 9 guests