c172p-team / c172p

A high detailed version of the Cessna 172P aircraft for FlightGear
GNU General Public License v2.0
80 stars 43 forks source link

Create a particle lighting control system #782

Closed wlbragg closed 6 years ago

wlbragg commented 8 years ago

Per Thorsten's advice I want to change the emissive value to true on all smoke and water particle effects, same as @onox did for the prop spray. I didn't want to potentially waist time with this without prior consent.

I tested the difference on all the "same" j3cub effects, sunset, clear skies. It appears you lose any atmospheric lighting changes in the effect (or they are very subtle) but we won't get any of the ugly weird color effects you might see at other specific lighting conditions.

onox commented 8 years ago

Sure go ahead. Just make sure you name the branch bug-782 so that it can be easily found.

wlbragg commented 6 years ago

I'm not sure where the initial information in this issue came from but I have it backward. emissive value should alway be false unless it is a spark or other effect that creates its own light. I checked all the effects and they all have the correct emission setting.

However, all these these particle effects need to use something similar to the following nasal control to achieve the correct lighting and color values for the effect regardless of time of day.

We need to create a particle lighting control system in nasal. Both the Aircrane and the Alouette-III have slightly different built in nasal logic for the rotor wash we could adapt for our particle effects. When finished we could have, for example, tire smoke one color, dust another and still another for snow and water spray. Plus the particle effect would react appropriately to the scene lighting conditions.

var red_diffuse = getprop("/rendering/scene/diffuse/red");
setprop("/sim/model/aircrane/effects/particles/rotorwash/redcombinedstart",   red_diffuse*.8);
setprop("/sim/model/aircrane/effects/particles/rotorwash/greencombinedstart", red_diffuse*.8);
setprop("/sim/model/aircrane/effects/particles/rotorwash/bluecombinedstart",  red_diffuse*.8);
setprop("/sim/model/aircrane/effects/particles/rotorwash/redcombinedend",     red_diffuse*.9);
setprop("/sim/model/aircrane/effects/particles/rotorwash/greencombinedend",   red_diffuse*.9);
setprop("/sim/model/aircrane/effects/particles/rotorwash/bluecombinedend",    red_diffuse*.9);
wlbragg commented 6 years ago

@gilbertohasnofb, @onox, This one is really bugging me. I was testing the new lighting systems at night an was landing on the water. The wake was bright white because we don't have any lighting control. I want to do this now even if it is only to correct any existing particle effects day and night ambient light. Eventually it would be nice to add color to the different types of effects and conditions.

Should I go ahead and add it in the glass effect branch or make a new branch for it?

wlbragg commented 6 years ago

I answered my own question. This is fairly extensive on its own.

This initial implementation covers the available scene lighting and overall terrain type on all the particle effects requiring particle lighting control. Overall being water, land and snow. I think the only thing I didn't look at yet is the exhaust. I don't know if it has the scene lighting accounted for.

Next stage would be to possibly include detailed terrain types and conditions into the equations. Such as, grass VS dirt or dry conditions VS wet conditions. These details could possible affect color as well if appropriate for the particle effect being applied.