Board index FlightGear Development Aircraft

CRJ700 family goes canvas

Questions and discussion about creating aircraft. Flight dynamics, 3d models, cockpits, systems, animation, textures.

CRJ700 family goes canvas

Postby jsb » Sat Nov 26, 2016 10:37 am

I create this thread to bring developers together that are interested in CRJ700 family and/or canvas based glas cockpit (PDF/MFD/EICAS etc.).
CRJ700 currently uses complex 3D models and animations to implement these screens. Implementing them as canvas displays will be quite some work but /may/ help to implement more details on the long run.

To collect docs / ideas I created a new page in the wiki: http://wiki.flightgear.org/CRJ_700_family_canvas
jsb
 
Posts: 285
Joined: Sat Oct 25, 2014 9:17 pm
Location: Hamburg, Germany
Callsign: D-JSB
Version: next
OS: Win7/Linux

Re: CRJ700 family goes canvas

Postby Hooray » Tue Nov 29, 2016 8:25 pm

For the corresponding ND (navdisplay) work ("style"), you may want to refer to:

http://wiki.flightgear.org/Canvas_ND_Fr ... _ND_Styles
http://wiki.flightgear.org/Howto:Protot ... play_Style

Image

The corresponding GUI dialog is pending review by Gijs and/or Hyde, so isn't yet available in fgdata as far as I am aware (haven't been following the commit logs though)
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: CRJ700 family goes canvas

Postby jsb » Thu Dec 01, 2016 10:19 pm

Thanks for the links, quite impressiv :)
I will dig into this and probably come back with questions ;)
jsb
 
Posts: 285
Joined: Sat Oct 25, 2014 9:17 pm
Location: Hamburg, Germany
Callsign: D-JSB
Version: next
OS: Win7/Linux

Re: CRJ700 family goes canvas

Postby Hooray » Sat Dec 03, 2016 11:45 am

great, I would suggest that you get in touch with other users who have recently been working on custom ND styles (e.g. clm76, artix etc): http://wiki.flightgear.org/Canvas_ND_Fr ... ft_Support

Usually, you can learn a lot by referring to their changes.

You may also want to use the dialog shown above to easily test your changes without having to exit/restart or reset FlightGear - it will automatically reload everything from disk whenever the dialog is closed/opened (or when changes are made)

Feel free to get in touch if the docs are too unclear - but please also feel free to get involved in helping update/improve the corresponding wiki articles.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: CRJ700 family goes canvas

Postby jsb » Tue Dec 06, 2016 10:13 pm

I included the PUI dialog and applied the changes mentioned in the Wiki. I found a bug in navdisplay.mfd causing a nasal runtime error on dialog reload
around line 270 the clip option must be embedded in rect()
Code: Select all
me.map = me.nd.createChild("map","map")
.set("clip", "rect("~map_rect~")")
.set("screen-range", 700);

Which brings me to the question how updates are coordinated, e.g. which repo etc?
jsb
 
Posts: 285
Joined: Sat Oct 25, 2014 9:17 pm
Location: Hamburg, Germany
Callsign: D-JSB
Version: next
OS: Win7/Linux

Re: CRJ700 family goes canvas

Postby jsb » Thu Dec 08, 2016 11:40 pm

Ok, here is my first problem while learning canvas basics:
I modelled a very simple display in blender, a frame and a separate object called "Screen" which is a plane with a black texture.
I put a XML beside it with parameters to be overlayed later on...
Code: Select all
<PropertyList>   
    <path>EFIS-display.ac</path>   
    <params>
      <name>EFIS_display_0</name>
      <powerN>/systems/DC/outputs/mfd1</powerN>   
      <lightmap-texture-path>Aircraft/Generic/generic-lightmap.png</lightmap-texture-path>
   </params>

   <animation>
      <name alias="/params/name" />
      <object-name>Screen</object-name>
   </animation>
    <animation>
      <type>material</type>
      <object-name alias="/params/name" />
      <condition>
         <greater-than>
            <property alias="/params/powerN" />
            <value>24</value>
         </greater-than>      
      </condition>
      <emission>
         <red>1</red>
         <green>1</green>
         <blue>1</blue>
         <factor-prop>controls/lighting/display-norm</factor-prop>
      </emission>
   </animation>
</PropertyList>


... and included the whole thing three times in the flightdeck.xml so I have my three displays for PFD,MFD,EICAS.
Code: Select all
    <model>
      <!-- <path>Aircraft/CRJ700-family/Models/Instruments/PFD/pfd.xml</path> -->
      <path>Aircraft/CRJ700-family/Models/Instruments/EFIS/EFIS-display.xml</path>
      <overlay>
         <params>
            <name>DisplayPFD1</name>
            <powerN>/systems/DC/outputs/pfd1</powerN>
            <lightmap-texture-path>Aircraft/CRJ700-family/Models/Effects/Lightmaps/pfd-left-lightmap.png</lightmap-texture-path>
         </params>
      </overlay>
      <offsets>
         <x-m>-1.9025</x-m>
         <y-m>-0.51396</y-m>
         <z-m>0.87135</z-m>
         <pitch-deg>-10</pitch-deg>
      </offsets>
   </model>
      <model>
<!-- similar for MFD, EICAS with other params/name -->

The material animation works nicely, the texture of the "Screen" object is dark dark grey and turning the knob will give some "CRT light".
Anyhow, trying to put a canvas placement on a node alias name fails, putting the placement on "Screen" will bring the same canvas texture to all three display units.
So the XML animation statement to declare an alias name for "Screen" per include does not work as I hoped.
Is there a way to include the display unit model/xml multiple times and rename the Screen object so each included screen can be addressed separately for canvas placement?
jsb
 
Posts: 285
Joined: Sat Oct 25, 2014 9:17 pm
Location: Hamburg, Germany
Callsign: D-JSB
Version: next
OS: Win7/Linux

Re: CRJ700 family goes canvas

Postby Umoxfo » Fri Dec 09, 2016 1:03 am

Each display should have its own object, so you should rename for "Screen" by each display, e.g. "ScreenL" and "ScreenR".
Umoxfo
 
Posts: 1
Joined: Fri Dec 09, 2016 12:52 am

Re: CRJ700 family goes canvas

Postby jsb » Fri Dec 09, 2016 8:49 am

That is for sure, but it is kind of pointless to make six file copies of the same thing just to rename one 3D plane.
It would be more efficient to include the 3D model for a display six times and just re-name the Screen to PFD1,MFD1, etc...
Edit: This is no problem at all in the XML animations, so hopefully there is a way to do it also for canvas <-> 3D model
jsb
 
Posts: 285
Joined: Sat Oct 25, 2014 9:17 pm
Location: Hamburg, Germany
Callsign: D-JSB
Version: next
OS: Win7/Linux

Re: CRJ700 family goes canvas

Postby PINTO » Fri Dec 09, 2016 9:05 pm

You can have 6 objects in one file...
Actively developing the MiG-21bis (github repo) (forum thread) (dev discord) (fg wiki)

http://opredflag.com is an active flightgear dogfighting community (using a system that isn’t bombable)
User avatar
PINTO
 
Posts: 966
Joined: Wed Oct 21, 2015 7:28 pm
Callsign: pinto
Version: stable
OS: Win10

Re: CRJ700 family goes canvas

Postby jsb » Sat Dec 10, 2016 1:09 am

That's not the point :) I am talking about structures and concepts.
jsb
 
Posts: 285
Joined: Sat Oct 25, 2014 9:17 pm
Location: Hamburg, Germany
Callsign: D-JSB
Version: next
OS: Win7/Linux

Re: CRJ700 family goes canvas

Postby Thorsten » Sat Dec 10, 2016 8:36 am

That is for sure, but it is kind of pointless to make six file copies of the same thing just to rename one 3D plane.


Should you ever later wish to run effects like lightmaps or opacity maps on the screens, I'd advise you to do just that and have six distinct meshes with six distinct uv-mappings or you'll be in for a nasty surprise.

There is also zero advantage in trying to be elegant here, in fact quite the opposite - the vertex number of a screen is a non-issue for the renderer whereas the draw change forced by you using an xml file to specify different names and different coordinate translations (aka new state set) will kill much more performance.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: CRJ700 family goes canvas

Postby jsb » Sat Dec 10, 2016 9:32 am

Ok, did not know about that one. Thanks for sharing this details :)
jsb
 
Posts: 285
Joined: Sat Oct 25, 2014 9:17 pm
Location: Hamburg, Germany
Callsign: D-JSB
Version: next
OS: Win7/Linux

Re: CRJ700 family goes canvas

Postby Hooray » Sat Dec 10, 2016 6:06 pm

jsb wrote in Tue Dec 06, 2016 10:13 pm:Which brings me to the question how updates are coordinated, e.g. which repo etc?



Back in the gitorious days, we used to maintain a "canvas-hackers" team clone - this isn't currently maintained anymore.
However, I agree that it would make sense to resurrect something like that - if in doubt, feel free to get in touch with other contributors actively working on the ND/MapStructure stuff to coordinate/share your changes that way - I'll try to make sure to help review/comment on your patches so that they can be more easily committed hopefully (may take me a week or two to get back to these discussions ATM).

Regarding the multi-instance use case and the questions you posed, this works indeed using different object names - internally, it's using a texture visitor to replace the static texture with the Canvas one - for details, search the forum/wiki for "canvas texture visitor" and you should find a few postings covering the details.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: CRJ700 family goes canvas

Postby jsb » Wed Dec 14, 2016 8:15 pm

After some more experiments with Canvas placements I will most probably revamp the flightdeck (some day) and include the six displays directly.
BTW Is there a performance or loading time penalty for including 3D (sub- sub-)models via the XMLs compared to puting things together directly in Blender and export into one .ac file?
jsb
 
Posts: 285
Joined: Sat Oct 25, 2014 9:17 pm
Location: Hamburg, Germany
Callsign: D-JSB
Version: next
OS: Win7/Linux

Re: CRJ700 family goes canvas

Postby Thorsten » Thu Dec 15, 2016 7:19 am

BTW Is there a performance or loading time penalty for including 3D (sub- sub-)models via the XMLs compared to puting things together directly in Blender and export into one .ac file?


In general yes to both - though dependent on circumstances it may be small to not measurable.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Next

Return to Aircraft

Who is online

Users browsing this forum: No registered users and 15 guests