Open colingeniet opened 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.
My terminology, because we seem to use opposite ones :)
/ai/models/multiplayer/<something>
is what I call local (in the context of MP models)/<something>
is what I call globalThe 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.
/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...
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:/rendering/scene/diffuse/red
is tied, which means effect do not work properly with it (they never update its value). This affect the Mach cone, which directly usesdiffuse/red
as parameter. The current solution is to instead use a duplicate propertydiffuse/red-unbound
, updated regularly in nasal.diffuse/red-unbound
, but rather its "inverse". Since effects parameters do not allow expression AFAIK, the parameter values are computed in nasal.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()
inModels/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).