OSGText Issues: Difference between revisions

Jump to navigation Jump to search
m
https://sourceforge.net/p/flightgear/mailman/message/37148949/
m (https://sourceforge.net/p/flightgear/mailman/message/37149005/)
m (https://sourceforge.net/p/flightgear/mailman/message/37148949/)
Line 7: Line 7:
Linux distros provide decently recent version of OSG, which means, flightgear in distro is currently broken by this. Indeed, if even OSG-3.4.1 is breaking the text animation, look how many distros are distributing flightgear already broken (as linked to the distributed OSG)<ref>https://sourceforge.net/p/flightgear/mailman/message/37149005/</ref>: https://repology.org/project/openscenegraph/versions
Linux distros provide decently recent version of OSG, which means, flightgear in distro is currently broken by this. Indeed, if even OSG-3.4.1 is breaking the text animation, look how many distros are distributing flightgear already broken (as linked to the distributed OSG)<ref>https://sourceforge.net/p/flightgear/mailman/message/37149005/</ref>: https://repology.org/project/openscenegraph/versions


If we go to OSG 3.6, they are broken, plain and simple.<ref>https://sourceforge.net/p/flightgear/mailman/message/37148949/</ref>


So we need to do some Real Work (TM) to support Canvas with osgText 3.6 and upwards, unfortunately.<ref>https://sourceforge.net/p/flightgear/mailman/message/36730965/</ref>
So we need to do some Real Work (TM) to support Canvas with osgText 3.6 and upwards, unfortunately.<ref>https://sourceforge.net/p/flightgear/mailman/message/36730965/</ref>
Line 25: Line 26:
== Background ==
== Background ==
With OSG 3.6, Aircraft {{tag|text}} animations will be broken <ref>https://sourceforge.net/p/flightgear/mailman/message/36240313/</ref> however: that’s the blocking issue stopping us moving to 3.6 everywhere. <ref>https://sourceforge.net/p/flightgear/mailman/message/37147614/</ref> OSG 3.6 has the text display issue <ref>https://sourceforge.net/p/flightgear/mailman/message/37126793/</ref>, currently osgText doesn't work under the ALS pipeline.  <ref>https://sourceforge.net/p/flightgear/mailman/message/37042335/</ref> one issue that seems to occur in a few places is missing text elements on cockpit devices ...  There are [https://sourceforge.net/p/flightgear/mailman/flightgear-devel/thread/1362c1cf-e0e7-3774-da92-63b2720aab7f%40gmail.com/#msg36702528 issues with osgText not working in OSG &gt; 3.4.2]. We need to find a migration solution for osgText that works with Compositor and newer OSG versions <ref>https://sourceforge.net/p/flightgear/mailman/message/37047567/</ref> ... another option was creating a Canvas for each text animation, but creating a FBO for every small piece of text doesn't sound very performance-friendly. <ref>https://sourceforge.net/p/flightgear/mailman/message/37042457/</ref> We need to find some way to approximate with the old OSG text did<ref>https://sourceforge.net/p/flightgear/mailman/message/37042476/</ref>
With OSG 3.6, Aircraft {{tag|text}} animations will be broken <ref>https://sourceforge.net/p/flightgear/mailman/message/36240313/</ref> however: that’s the blocking issue stopping us moving to 3.6 everywhere. <ref>https://sourceforge.net/p/flightgear/mailman/message/37147614/</ref> OSG 3.6 has the text display issue <ref>https://sourceforge.net/p/flightgear/mailman/message/37126793/</ref>, currently osgText doesn't work under the ALS pipeline.  <ref>https://sourceforge.net/p/flightgear/mailman/message/37042335/</ref> one issue that seems to occur in a few places is missing text elements on cockpit devices ...  There are [https://sourceforge.net/p/flightgear/mailman/flightgear-devel/thread/1362c1cf-e0e7-3774-da92-63b2720aab7f%40gmail.com/#msg36702528 issues with osgText not working in OSG &gt; 3.4.2]. We need to find a migration solution for osgText that works with Compositor and newer OSG versions <ref>https://sourceforge.net/p/flightgear/mailman/message/37047567/</ref> ... another option was creating a Canvas for each text animation, but creating a FBO for every small piece of text doesn't sound very performance-friendly. <ref>https://sourceforge.net/p/flightgear/mailman/message/37042457/</ref> We need to find some way to approximate with the old OSG text did<ref>https://sourceforge.net/p/flightgear/mailman/message/37042476/</ref>


For the time being, we don’t (often) use OSG 3.6 - looking at the code on master (which became 3.6), there isn’t a single commit we can revert - Robert evidently did a lot of incremental improvements to the text code, adding support for other features and improving the shader support. Then at some point he collected a subset of those changes and back-ported them to 3.4 branch, which is what we revert in the commit on my fork on GitHub.
For the time being, we don’t (often) use OSG 3.6 - looking at the code on master (which became 3.6), there isn’t a single commit we can revert - Robert evidently did a lot of incremental improvements to the text code, adding support for other features and improving the shader support. Then at some point he collected a subset of those changes and back-ported them to 3.4 branch, which is what we revert in the commit on my fork on GitHub.
Line 32: Line 32:


(The text animation assumes that setting all of emissive/ambient/diffuse/specular works on an osgText, and it no longer does - for some cases we could map the emissive color to the text color, but this would break some other cases…. and text still won’t receive normal lighting in that case)<ref>https://sourceforge.net/p/flightgear/mailman/message/36703340/</ref>
(The text animation assumes that setting all of emissive/ambient/diffuse/specular works on an osgText, and it no longer does - for some cases we could map the emissive color to the text color, but this would break some other cases…. and text still won’t receive normal lighting in that case)<ref>https://sourceforge.net/p/flightgear/mailman/message/36703340/</ref>
There are some ways to fix that, but they might break aircraft compatibility (but that is maybe inevitable for this, to some degree)
The best solution we discussed so far is: render the text to a texture (using the official osgText shaders from 3.6), and then apply that texture as a decal in 3D. This would allow effects to be used, which is what we need to fix the lighting problems. (mostly…)  The problem is this means defining a texture quad which is correctly positioned (in terms of Z-offset) above the panel / model the text appears on.
Now, all of the above is /also/ true for osgText in 3.4.0; so the aircraft developers already configured (presumably) a position + offset which gives acceptable tradeoff of ‘appearing coplanar’ and ‘avoiding Z-fighting’. The question is whether we can mimic what old osgText did, close enough that most aircraft work unmodified. And we won’t know that until someone creates the replacement code.<ref>https://sourceforge.net/p/flightgear/mailman/message/37148949/</ref>




Navigation menu