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 5: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: 9909
Joined: Mon Nov 02, 2009 8:33 am

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

Postby Icecode GL » Wed Jun 07, 2017 6: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 GL
 
Posts: 464
Joined: Thu Aug 12, 2010 12:17 pm
Location: Spain
Callsign: icecode
Version: GIT
OS: Arch Linux

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

Postby Thorsten » Wed Jun 07, 2017 6: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: 9909
Joined: Mon Nov 02, 2009 8:33 am

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

Postby Icecode GL » Wed Jun 07, 2017 6: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 GL
 
Posts: 464
Joined: Thu Aug 12, 2010 12:17 pm
Location: Spain
Callsign: icecode
Version: GIT
OS: Arch Linux

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

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

Oh, this is very exciting for those of us that are into helo's! :)
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4116
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

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

Postby Thorsten » Thu Jun 08, 2017 2: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: 9909
Joined: Mon Nov 02, 2009 8:33 am

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

Postby Icecode GL » Thu Jun 08, 2017 3: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 GL
 
Posts: 464
Joined: Thu Aug 12, 2010 12:17 pm
Location: Spain
Callsign: icecode
Version: GIT
OS: Arch Linux

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

Postby Thorsten » Thu Jun 08, 2017 5: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: 9909
Joined: Mon Nov 02, 2009 8:33 am

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

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

Thorsten wrote in Thu Jun 08, 2017 2: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: 609
Joined: Sun Nov 02, 2014 10:17 pm
Version: Git
OS: Win10

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

Postby Icecode GL » Fri Jun 09, 2017 1: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 GL
 
Posts: 464
Joined: Thu Aug 12, 2010 12:17 pm
Location: Spain
Callsign: icecode
Version: GIT
OS: Arch Linux

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

Postby Thorsten » Fri Jun 09, 2017 2: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: 9909
Joined: Mon Nov 02, 2009 8:33 am

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

Postby Icecode GL » Fri Jun 09, 2017 2: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 GL
 
Posts: 464
Joined: Thu Aug 12, 2010 12:17 pm
Location: Spain
Callsign: icecode
Version: GIT
OS: Arch Linux

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

Postby wlbragg » Fri Jun 09, 2017 3: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(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4116
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

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

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

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

Thorsten wrote in Thu Jun 08, 2017 2: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)
Johan G
Moderator
 
Posts: 5292
Joined: Fri Aug 06, 2010 5:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 3.0.0
OS: Windows 7, 32 bit

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

Postby wlbragg » Thu Jun 29, 2017 6: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(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4116
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

PreviousNext

Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 4 guests