NikolaiVChr / flightgear-saab-ja-37-viggen

Saab 37 Viggen for Flightgear flight simulator
http://wiki.flightgear.org/Saab_37_Viggen
GNU General Public License v2.0
26 stars 15 forks source link

Mach cone / A/B flame effects broken over MP #174

Open colingeniet opened 3 years ago

colingeniet commented 3 years ago

Longstanding issue, I'm trying to at least document it.

Context

These effects have parameters which depend on /rendering/scene/diffuse/red, used to adjust their brightness depending on the scene light (makes the vapour cone darker and the flame more visible at night). There's a lot of issues with that:

With these hacks, the effects work properly locally.

MP Effects—current state

MP models is where it gets fun. Say aircraft A is looking at a MP model Viggen (aircraft B).

Nasal in MP Model

As of v5.0.0, the xml model files contain Nasal code to update these parameters from MP models, meaning that the Nasal code from MP model B will update the properties for A (cf. color_loop() in Models/JA37Di-Viggen.xml). This doesn't work: the effects do not use these properties. I suspect the issue is that the property doesn't exist yet when the effect is set up (MP model nasal block runs after effects are loaded).

NikolaiVChr commented 3 years ago

I suspect the issue is that the property doesn't exist yet when the effect is set up (MP model nasal block runs after effects are loaded).

Effects cannot use MP properties, on dev list they kinda indicated it was not something easy to fix. So myProperty wont work. Only will read from /myProperty So just make a local (absolute) property for scene red, that is not bound. Since scene red is used in almost all our aircraft in effects, I think we could install that at least in all OPRF aircraft.

colingeniet commented 3 years ago

My terminology, because we seem to use opposite ones :)

The Nasal code I'm referring to was trying to set the global/absolute properties (i.e. the ones the effects should use). It still doesn't work.

colingeniet commented 3 years ago

/rendering/scene/diffuse/red being unusable in effects sounds like something which should be possible to fix in FG. Either by improving the code which reads parameters in effects, or by fixing how /rendering/scene/diffuse/red is tied. (I could be talking nonsense, but I think there are new/good and old/bad tied properties, and I assume it is an old/bad one).

Of course that only helps with next...