Board index FlightGear Development Effects and shaders

Volumetric grass (was 3D textures and volumetric data)

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

Re: Volumetric grass (was 3D textures and volumetric data)

Postby Thorsten » Wed Jun 07, 2017 6:52 pm

Do you see a picture of grass radially bending outward from a point? If so, I must have done something wrong, though I can't see what.

I actually wiped my code in frustration (was just ~five lines anyway) - it looked fairly similar to yours, except I did 2d coordinates to save a varying float. I'll have another go at this tomorrow... if I can't make it, I'll post the code.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Volumetric grass (was 3D textures and volumetric data)

Postby icecode » Wed Jun 07, 2017 7:00 pm

This is what I get, with exagerated bending to better notice it:

Image

It's not in FG but the shaders are exactly the same as the ones upstream, minus the lighting code, so it shouldn't matter.

I actually wiped my code in frustration (was just ~five lines anyway)


That happens to me a lot more that it should. :mrgreen:
icecode
 
Posts: 708
Joined: Thu Aug 12, 2010 1:17 pm
Location: Spain
Version: next
OS: Fedora

Re: Volumetric grass (was 3D textures and volumetric data)

Postby Thorsten » Wed Jun 07, 2017 7:02 pm

Hm, that pretty much looks like it should. Which at least tells me that I did something wrong, which means all I have to do is work out what it was...

Thanks.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Volumetric grass (was 3D textures and volumetric data)

Postby icecode » Wed Jun 07, 2017 7:06 pm

Does the whirl you are talking about look like this?

Image

If so, it has to do with the negative sign at one of the xy coordinates of the fragment position.
That's the only thing I can think of.
icecode
 
Posts: 708
Joined: Thu Aug 12, 2010 1:17 pm
Location: Spain
Version: next
OS: Fedora

Re: Volumetric grass (was 3D textures and volumetric data)

Postby wlbragg » Wed Jun 07, 2017 7:41 pm

Oh, this is very exciting for those of us that are into helo's! :)
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7574
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Volumetric grass (was 3D textures and volumetric data)

Postby Thorsten » Thu Jun 08, 2017 3:41 pm

If so, it has to do with the negative sign at one of the xy coordinates of the fragment position.


You were right - that was the problem. Should have seen this myself...

This sort of works when augmented by some aircraft-side helper script:

Image
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Volumetric grass (was 3D textures and volumetric data)

Postby icecode » Thu Jun 08, 2017 4:50 pm

That's looking pretty good!

I suggest using another sine wave to modulate the domain of the wind generator function, so you get kind of a waving effect horizontally. Something like the waves formed when a water droplet is dropped:
Image
icecode
 
Posts: 708
Joined: Thu Aug 12, 2010 1:17 pm
Location: Spain
Version: next
OS: Fedora

Re: Volumetric grass (was 3D textures and volumetric data)

Postby Thorsten » Thu Jun 08, 2017 6:14 pm

It's... moderately tricky the way the wind/gust code works, strong gradients in the windfield lead to artifacts when you move one part of a grass blade with a different frequency than the other part.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Volumetric grass (was 3D textures and volumetric data)

Postby Richard » Fri Jun 09, 2017 10:30 am

Thorsten wrote in Thu Jun 08, 2017 3:41 pm:This sort of works when augmented by some aircraft-side helper script:


That's looking quite incredible.

Instead of an aircraft side script do you think it's feasible to modify yasim[1] to output the required properties

---------------
[1] yasim seems to be the preferred choice for helicoptering.
Richard
 
Posts: 810
Joined: Sun Nov 02, 2014 11:17 pm
Version: Git
OS: Win10

Re: Volumetric grass (was 3D textures and volumetric data)

Postby icecode » Fri Jun 09, 2017 2:54 pm

I'm not aware of what specific values Thorsten needs for his current implementation, but generally you can pass any property tree node to a shader via an uniform, even FDM-driven ones.
icecode
 
Posts: 708
Joined: Thu Aug 12, 2010 1:17 pm
Location: Spain
Version: next
OS: Fedora

Re: Volumetric grass (was 3D textures and volumetric data)

Postby Thorsten » Fri Jun 09, 2017 3:48 pm

but generally you can pass any property tree node to a shader via an uniform, even FDM-driven ones.


Nope - at the moment JSBSim created tied properties which the effect framework doesn't handle gracefully, which is why you can see the Shuttle pass a lot of FDM stuff through trivial gain filters just to make the output palatable for the shaders. Not sure what YaSim does.

In a broader sense, the issue is how much of this we'd like to hard-code and how much have configurable.

Think e.g. of a quad-copter drone - do we want to separate the downwash into four flow fields or merge it into one? The effect framework will (obviously) take only a limited set of nodes, so should YaSim really get to decide what to do for more than one rotor?

I'm very reluctant to hard-code such things and take them out of control of the maintainer, the outcome might easily be poor.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Volumetric grass (was 3D textures and volumetric data)

Postby icecode » Fri Jun 09, 2017 3:58 pm

Nope - at the moment JSBSim created tied properties which the effect framework doesn't handle gracefully


Didn't know that. To be honest I've never tinkered with JSBSim properties, so maybe it works on YASim only? I'm not so sure anymore. :)

In a broader sense, the issue is how much of this we'd like to hard-code and how much have configurable.


I personally hate hardcoding things. FG doesn't have a single FDM model with a single team of aircraft developers working with it, so hardcoding anything would probably work in 50% of the cases. The aircraft developer should have complete control on what to input to the shader, and the shader should default to just follow atmospheric wind movement.
icecode
 
Posts: 708
Joined: Thu Aug 12, 2010 1:17 pm
Location: Spain
Version: next
OS: Fedora

Re: Volumetric grass (was 3D textures and volumetric data)

Postby wlbragg » Fri Jun 09, 2017 4:45 pm

I'm very reluctant to hard-code such things and take them out of control of the maintainer

The aircraft developer should have complete control on what to input to the shader, and the shader should default to just follow atmospheric wind movement.

I agree with this. To me this is ideal with the most flexibility.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7574
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Volumetric grass (was 3D textures and volumetric data)

Postby Johan G » Sat Jun 10, 2017 9:14 pm

Ditto. Flexibility is probably FlightGear's greatest strength. *

Thorsten wrote in Thu Jun 08, 2017 3:41 pm:This sort of works when augmented by some aircraft-side helper script:

That looks absolutely amazing already. :D

* Though some less well documented features can sometimes make that flexibility a weakness. E.g. through properties with less well known intended use.
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: 6625
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

Re: Volumetric grass (was 3D textures and volumetric data)

Postby wlbragg » Thu Jun 29, 2017 7:05 am

Here is an example of some of the great work by Icecode GL and Thorsten. This is shader effect only, imagine adding some particle effects or possibly a shader dust effect to complete the rotor wash effect. What a really nice addition to the effects arsenal.

Thanks to the both of you!





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

PreviousNext

Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 3 guests