Board index FlightGear Development Effects and shaders

Particle effects and particle color.

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

Particle effects and particle color.

Postby wlbragg » Wed Jul 19, 2017 7:29 pm

It was my understanding that we should be using /rendering/scene/diffuse/red for all colors in our standard particles for things like tire smoke water spray etc.

Did I misunderstand this and it is OK to also use the other two rgb colors?

It seems not only will your effect dissipate with darkness but might also match the ambiance of the scene better using all three?

I also have experimented with using a /rendering/scene/diffuse/ factor for a specific color or really more for a specific shade.

For example, /rendering/scene/diffuse/x * .1 VS /rendering/scene/diffuse/x * .9 gives you dark dust vs light spray.

I am using it in the AirCrane to change the rotor wash particles from dark to light when transitioning from land to water.

Add a bit of color
/rendering/scene/diffuse/r * .8
/rendering/scene/diffuse/g * 1
/rendering/scene/diffuse/b * 1
and you start getting water colored spray that turns dark at night.

Is there anything I am missing here, any reasons not to do this if done in moderation?

Taking this concept one step farther, does the property tree expose more details of the scene, like surface colors, water for example? If not we should be exposing this type of information. Material type would be helpful. I think all I ever found was things like friction factor.

One area I am really uneducated in is our shader base. I know there is more shader effects available than ever before, at least working examples, but it seems so mysterious and not intuitive, at least for me. I would really like to start converting all these effects to a shader solution and generalizing it enough to allow others to integrate them easily, but I am unclear as exactly where to start. Maybe contrails, don't we have shader effects for those? Also the Shuttle plume, maybe a place to start?
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7586
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Particle effects and particle color.

Postby Thorsten » Wed Jul 19, 2017 7:48 pm

It seems not only will your effect dissipate with darkness but might also match the ambiance of the scene better using all three?


These are the non-ALS scene colors - to the degree that ALS has different colors at low sun as compared with other renderers (for instance muted blue due to cloud cover vs. bright red in Classic), they'll stand out glaringly wrong.

And I mean really glaringly wrong, not just a bit wrong.

Flat (grey) lighting of particles as recommended is a compromise working for all renderers under all lighting conditions. If you need colored particles, you can assign colors as multiples of /rendering/scene/diffuse/red (see how the Shuttle colors for instance the FES exhaust).

Taking this concept one step farther, does the property tree expose more details of the scene, like surface colors, water for example?


The water color is either a texture or computed procedurally inside the shader (and generally different pixel by pixel) - you can't expose that to the property tree in a meaningful way.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Particle effects and particle color.

Postby wlbragg » Wed Jul 19, 2017 8:17 pm

These are the non-ALS scene colors - to the degree that ALS has different colors at low sun as compared with other renderers (for instance muted blue due to cloud cover vs. bright red in Classic), they'll stand out glaringly wrong.

Oh, thanks for the clarification, glad I found out now before I went too far down that hole.

The water color is either a texture or computed procedurally inside the shader (and generally different pixel by pixel) - you can't expose that to the property tree in a meaningful way.

I know in some game design they take a sample of the concerning area of the texture and average out a color value and use it to compute the color for an effect. Probably too expensive for us.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7586
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Particle effects and particle color.

Postby wlbragg » Wed Jul 19, 2017 8:23 pm

These are the non-ALS scene colors

Are the ALS colors accessible in the property tree?

If they are, or were made to be accessible, you could account for the renderer.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7586
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Particle effects and particle color.

Postby Thorsten » Thu Jul 20, 2017 6:30 am

Are the ALS colors accessible in the property tree?


There's as many ALS light colors as there's pixels on your screen (theoretically at least, floating point accuracy is limited in practice, so some of them will be identical).

The central point of ALS is that there is no such thing as 'scene light color'. If you are down in a valley, beneath cloud cover, the light might be bluish and muted, but you can see a summit from there, and that may have bright golden light.

To do this, we compute light for every pixel on the screen dependent on its position relative to the sun, and the result of that computation is not always the same. Even if we could access the GPU memory easily to extract the color values, the property tree could not easily hold two million values.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Particle effects and particle color.

Postby Thorsten » Thu Jul 20, 2017 12:07 pm

I think the crux of the matter is that the particle system sucks, using /rendering/scene/diffuse/r is a hack that mitigates the lighting problems, you'd like to introduce a somewhat better hack, but a real solution in my book would only be to run a shader over everything so that lighting can be computed properly.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Particle effects and particle color.

Postby bugman » Thu Jul 20, 2017 1:33 pm

Wayne, maybe you need something like this for your water canon:


Regards,
Edward
bugman
Moderator
 
Posts: 1808
Joined: Thu Mar 19, 2015 10:01 am
Version: next

Re: Particle effects and particle color.

Postby wlbragg » Thu Jul 20, 2017 5:04 pm

Nice!

I really do plan to dive into the shader arena eventually. It does appear to be the way forward. That's certainly some incentive. :)
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7586
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070


Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 3 guests