Board index FlightGear Development Aircraft

F-20 development

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

Re: F-20 development

Postby Flying toaster » Sat Sep 21, 2013 8:04 am

Philosopher wrote in Sat Sep 21, 2013 2:57 am: One comment is that the afterburner/petal animations still work after the engine is turned off – because of that, it was even more weird when my aircraft didn't move, besides the fact that I didn't expect Shift+Q to work :lol:. Starting it up again was a bit of a hassle since it seemed like the start button needed to be pressed while resupplying fuel flow – I personally would like delay deactivating the starter by a bit (that's just a little bit of binding work), but I don't know how other JSBSim jets do it.


The goal of the project is to have a fully functional virtual cockpit. So for the time being I haven't worked on the start procedure. The engine start procedure on the basic F-20 was to connect a start cart (hence the 3D model), have the aircraft on chocks (to be implemented) start the batteries, fuel pumps, and move the throttle out of the cutoff position. Alternately you could use pressure coming from a gas generator fed from a hydrazine cartidge. Not a very environmental friendly procedure since hydrazine is a health hazard if leaked, and even though a Northrop commercial claimed a 20s (!) start procedure based on the use of the method (with movies to prove it), the flight manual does not mention this possibility. Later versions were to have a jet fuel starter (a gas turbine starter) but with a weight penalty.

Philosopher wrote in Sat Sep 21, 2013 2:57 am:In general, it could use a bit of updating the help (e.g. "o" is the drag chute, which doesn't do anything despite having nice coding ;)) and some finishing work in areas, but it's pretty darn good! I have no idea of what is on your todo list, but I was wondering if I could help out some? Projects work better with two :)


Actually, since this aircraft is going to be complex to use, I intend to write a manual in the form of a document (similar to what I did with the Su-26M) so that should be helpful. I Intend of course to provide some online help but yet.
As far as the aspects were I could use some help. Actually I think that if you only have a full virtual cockpit, most people will be deterred from using it. So there must be a simpler way of doing things.
I am thinking that the sim could start with a (canvas generated) GUI, were you could have the following choices ;
- Engine running or cold aircraft
- Use simplified of complete start procedure
- Enter the flight plan manually using lat-long coordinates (that was the way you used it in real life) or set the waypoints using identifiers and load the flight plan in the navigation computer (using a map to draw the FP would be the icing on the cake, but that is a bit of a nightmare to code)

As for what is in the todo list... Well the full virtual cockpit with working systems (minus the weapon system), a few more liveries I have on my mind, three versions
- prototype, that is the aircraft as actually flown, albeit I am not in a hurry to make the first prototype since it had the regular F-5 canopy (not so pretty)
- First production standard proposed (that is with Chaff/Flare, RWR, and VOR/ILS navigation, supposed to fire the Sparrow III missile ... but no weapon systems)
- And upgraded version proposed to singapore or taiwan with the aforementioned jet fuel starter, and an autopilot (supposed to fire the AIM-120... but ... you get my meaning ;) )
You realise if you detail all of this, there is an awful lot to do yet.
Just be patient, I will keep you posted with progress (right now working on the FCS ;) )
Flying toaster
 
Posts: 353
Joined: Wed Nov 29, 2006 6:25 am
Location: Toulouse France

Re: F-20 development

Postby Thorsten » Tue Oct 22, 2013 6:32 am

Very pretty...

Image
Image
Image
Image

I've been wondering two things:

1) I seem to get unusually low framerates with the F-20 - I can fly the same scenery with the DR-400 or the EC-135 which both have photorealistic cockpit texturing (or even with the new 707 which has a very detailed cockpit with tons of instruments) and get the GPU locking to 30 fps even with quite a bit more clouds - but with the F-20, my framerate even for the almost cloudless skies shown is between 20 and 30. It seems the plane is quite a bit more expensive than others on my computer. Is there any significant overhead?

2) about the only thing I'm missing for it to feel 'real' is some structure on the inner cockpit surfaces, the monochromatic colors just don't look right. Do you have plans to address that?

Thanks for the work - it's really a nice addition to the FG fleet!
Thorsten
 
Posts: 11190
Joined: Mon Nov 02, 2009 8:33 am

Re: F-20 development

Postby Flying toaster » Tue Oct 22, 2013 6:47 am

Thorsten wrote in Tue Oct 22, 2013 6:32 am:I've been wondering two things:

1) I seem to get unusually low framerates with the F-20 - I can fly the same scenery with the DR-400 or the EC-135 which both have photorealistic cockpit texturing (or even with the new 707 which has a very detailed cockpit with tons of instruments) and get the GPU locking to 30 fps even with quite a bit more clouds - but with the F-20, my framerate even for the almost cloudless skies shown is between 20 and 30. It seems the plane is quite a bit more expensive than others on my computer. Is there any significant overhead?

I have no definite answer. The cockpit has quite a few polygons, but then again I have been told not to worry about that, and when I see the 707 I can agree.
I use a lot of individual texture files, if anything to get sharp textures on some instruments. I have read this practice is not frame rate friendly.
The FCS is somewhat heavier than what I was used to, but it did not have a significant impact on my rig.
Another point is that the canvas hud may be a bit too high res (1024x1024). I may tone this down, especially since rembrandt pixelates it badly (why still beats me).
Finally I have a lot of nasal code in the frame update (that is settimer with 0 delay).
I may have part of it with a different timer update rate.
I have hard time making benchmarks on my computer since scenery objects and 3D clouds are the main frame rate killers on my 6 years old rig (well the GC is not that old but still a core2 6600). I make my tests near Souda Bay (Crete is a nice place to fly) and get 20-30fps (no clouds, barren scenery). SF is strictly forbidden on my computer or FG turns into a slideshow.
After that I am pretty clueless

Thorsten wrote in Tue Oct 22, 2013 6:32 am:2) about the only thing I'm missing for it to feel 'real' is some structure on the inner cockpit surfaces, the monochromatic colors just don't look right. Do you have plans to address that?

I intend to texture the cockpit, but I must admit that weathering is not my strong point, so it may look too much "right out of factory" :(
Any help in that respect is welcome

Thorsten wrote in Tue Oct 22, 2013 6:32 am:Thanks for the work - it's really a nice addition to the FG fleet!

Thank you for the feedback, it is always appreciated and it helps improving !
Flying toaster
 
Posts: 353
Joined: Wed Nov 29, 2006 6:25 am
Location: Toulouse France

Re: F-20 development

Postby Thorsten » Tue Oct 22, 2013 6:52 am

Any help in that respect is welcome


You could try to experiment with the grain effect I introduced for ALS - simply create a mostly transparent texture with some noise dots on it, then declare it as grain texture and superimpose it to the surfaces (I'm assuming the plane is rendered with model-combined-deferred.eff) - that should make the surfaces look a bit more real for cheap. I think just some noise on the grey color would do miracles.
Thorsten
 
Posts: 11190
Joined: Mon Nov 02, 2009 8:33 am

Re: F-20 development

Postby Hooray » Tue Oct 22, 2013 10:26 am

Use the performance monitor and/or the osg statistics to see where time is spent - that will at least help you determine if there's something obvious wrong, such as rogue Nasal code, if it's due model complexity/polygon count, it should also show up in paused state when viewing just the exterior
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: 11375
Joined: Tue Mar 25, 2008 8:40 am

Re: F-20 development

Postby Thorsten » Thu Oct 24, 2013 5:31 pm

Okay, the culprit for the framerate drop is rendering the instrument panel. Looking down with the full panel in view I'm getting a mere 15 fps even on the runway, whereas looking out of the cockpit to the side, rendering the terrain fullscreen I get 50 fps.

That rules out Nasal because it'd slow down everything equally, and it rules out any terrain effect, as looking down on the runway vertex and fragment load from anything else but the aircraft is really low. Maybe that can be optimized...

Apart from that - big thumbs up for the afterburner flame, that's the best solution I've seen so far! The whole aircraft is really a joy to fly.
Thorsten
 
Posts: 11190
Joined: Mon Nov 02, 2009 8:33 am

Re: F-20 development

Postby Flying toaster » Thu Oct 24, 2013 10:44 pm

Thorsten wrote in Thu Oct 24, 2013 5:31 pm:Okay, the culprit for the framerate drop is rendering the instrument panel. Looking down with the full panel in view I'm getting a mere 15 fps even on the runway, whereas looking out of the cockpit to the side, rendering the terrain fullscreen I get 50 fps.

That rules out Nasal because it'd slow down everything equally, and it rules out any terrain effect, as looking down on the runway vertex and fragment load from anything else but the aircraft is really low. Maybe that can be optimized...


That *is* strange since I am getting the exact opposite behavior. I get better frame rates when looking down inside the cockpit rather than out. Then again I use stock release of FG (not git) and it may explain a few things (particularly why I do not have that insane terrain shader you show in your shots :) ). Another explanation may lay in the CG (I use a Nvidia GTX 550Ti with proprietary drivers).

Thorsten wrote in Thu Oct 24, 2013 5:31 pm:Apart from that - big thumbs up for the afterburner flame, that's the best solution I've seen so far! The whole aircraft is really a joy to fly.

Thanks :oops:. I think you may have seen the AB effect before as I released it for public use a while ago. I will fine tune colors as time (and aircraft) go by

And now time for a update.
A few instruments have been added to the cockpit ( no background texture yet), and I have started toying with flares. I use a mixture of submodels and particles, but I cannot get them to fire from the location I specified in <x-offset>...
Need to investigate that one
Image
I played with canvas to achieve this
Image
that is, the flare launcher will empty as you fire flares
In order to launch flares you need to set up the flares selector either in single or program mode (point the knob with the mouse pointer and use the scrollwheel)
Image
Once you have made your selection, press control+f and you should start the (unimpressive) fireworks... Still a long way to get the result I want to achieve, but gives you an idea :D

The new archive is available at this link
You have 4 usable variants :
F-20
F-20bmw
F-20A
F-20-dutchdemo

F-20 and F-20bmw have incomplete cockpits yet. F-20bmw and F-20-dutchdemo use special shaders (metallic shine) even though F-20bmw could take some serious improvement (particularly enlarging the specular highlight to make the metallic shine appear more readily).

Enjoy, and as usual, feedback and criticism is very welcome

Cheers
Flying toaster
 
Posts: 353
Joined: Wed Nov 29, 2006 6:25 am
Location: Toulouse France

Re: F-20 development

Postby Thorsten » Mon Oct 28, 2013 4:30 pm

I have no definite answer. The cockpit has quite a few polygons, but then again I have been told not to worry about that, and when I see the 707 I can agree.


Hm, I have to check this. You're probably not running ALS, right? That needs to do lots of lighting geometry in the vertex shader, and that means it would feel the number of polygons. I don't know how many vertices quite a few are, are we talking O(10k), O(100k), O(1M)? Vertex count does matter at some point.

I'm not really dropping below any critical performance, but there are lots of users with less powerful GPUs.
Thorsten
 
Posts: 11190
Joined: Mon Nov 02, 2009 8:33 am

Re: F-20 development

Postby Flying toaster » Mon Oct 28, 2013 4:56 pm

Thorsten wrote in Mon Oct 28, 2013 4:30 pm:
Hm, I have to check this. You're probably not running ALS, right? That needs to do lots of lighting geometry in the vertex shader, and that means it would feel the number of polygons.

I think I don't since I don't even know what ALS stands for :oops:

Thorsten wrote in Mon Oct 28, 2013 4:30 pm: I don't know how many vertices quite a few are, are we talking O(10k), O(100k), O(1M)? Vertex count does matter at some point.

I'm not really dropping below any critical performance, but there are lots of users with less powerful GPUs.

We are talking the order of 25-50k vertices/polygons for the whole cockpit (so far). It should stabilise to a 30-60k value. And then I guess there is backface culling so it must be pretty less actually rendered at any given time.
May be the number of different textures is an issue there ... I guess if you could try removing them all but one and see if there is any improvement in your setup.
Last edited by Flying toaster on Mon Oct 28, 2013 5:06 pm, edited 1 time in total.
Flying toaster
 
Posts: 353
Joined: Wed Nov 29, 2006 6:25 am
Location: Toulouse France

Re: F-20 development

Postby Hooray » Mon Oct 28, 2013 4:59 pm

I would also guess that it's mostly textures that are dominant here - some of our more complex 2D panels are known to have massive performance impact, so I would try to disable textures and see if that improves framerate in wireframe mode - if that's the case, the polygon count shouldn't be a factor here.
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: 11375
Joined: Tue Mar 25, 2008 8:40 am

Re: F-20 development

Postby Thorsten » Mon Oct 28, 2013 6:10 pm

We are talking the order of 25-50k vertices/polygons for the whole cockpit (so far).


Okay, that's harmless.

ALS is the 'Atmospheric Light Scattering' framework by the way (=my playground...)
Thorsten
 
Posts: 11190
Joined: Mon Nov 02, 2009 8:33 am

Re: F-20 development

Postby 5H1N0B1 » Thu Dec 19, 2013 1:18 pm

Hi !!
I was looking inyour Aircraft to find some Canvas stuff that I could inspire myself for the m2000-5...

And I had a look on your nasal files. This is outstanding. This is what i want to be close for my code.

- I started to code a "slat computed control"....You already did it, and you did it in the very detailled way...(it's ajusted not only with Alpha-deg & G but also with speed)

- I was looking for a kind of stabilisation system : In reality, when you pull the stick of the 2000, it stays stable and have really smooth move until you pull more than ~70% : At this moment the computer really understand you need to turn...and it turn at very agressive way...
And you did the SAS.nas
etc...

I don't think tere is a lot of fighter with this kind of detailled reality, and I think they should be.
If you don't mind i'll try to take a little of your code to put on the 2000. Cause It would be better if don't reinvent the weel, especially when it's a good one... :D
Thanks.

5H1N0B1
5H1N0B1
"Each day, with every person you meet, there is something to learn"
5H1N0B1
 
Posts: 211
Joined: Thu Aug 30, 2012 9:36 am
Location: France
Callsign: 5H1N0B1
IRC name: _5H1N0B1
Version: GIT
OS: Ubuntu

Re: F-20 development

Postby Hooray » Thu Dec 19, 2013 1:33 pm

it would be even better to generalize such things and come up with Nasal-space frameworks.
No unnecessary copy&paste please.
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: 11375
Joined: Tue Mar 25, 2008 8:40 am

Re: F-20 development

Postby Flying toaster » Thu Dec 19, 2013 6:51 pm

Thanks for the kudos :oops:

The flaps/slat schedule is actually derived from the logic described in the flight manual of the F-20 (quite easy).
The advantage of having it in nasal rather than JSBSim is that I will be able to have connections to the hydraulics and electrical system for failure simulation.
The downside is that it runs with the display frame rate. For flight controls laws it can lead to serious controlability issues if the frame rate drops too much.
As far as the SAS is concerned, I am afraid that the SAS.nas is a leftover from the F-14, since the flight controls laws of the F-20 are implemented using JSBsim with multi-stage control laws.
It implied a lot of trial and error on the control gains, some physical sense, but it could still stand some improvement (post stall behavior particularly).
If you intend to build a SAS using nasal, then the tomcat is a more stable basis (the original FDM I did for it was in YASim).

Regarding the possibility to factor some code I am all for it, even though I would even be happier to have as much as possible in the code base rather than in the nasal library (if anything for the sake of performance, we are talking inner loop functions there).
But as far as flight control laws are concerned, they are more often than not very specific to each manufacturer, and there are a lot of approaches available (hard vs. soft limits, SAS vs. full FBW ...)
The reason why this is all open source is that because we can benefit from the work of each other. So feel free to use/alter/improve whatever you find in my packages ! BTW the X-15 has a FDM written in JSBSim with a FCS in nasal if needed.
Flying toaster
 
Posts: 353
Joined: Wed Nov 29, 2006 6:25 am
Location: Toulouse France

Re: F-20 development

Postby Flying toaster » Sun Apr 13, 2014 7:37 am

Hi everybody.

Started to work again to port the tigershark to FG 3.0 (BTW I am impressed by the improvement in frame rate !). I have ran into this problem :

Code: Select all
 
  at /usr/local/share/FlightGear/data/Nasal/props.nas, line 33
  called from: /usr/local/share/FlightGear/data/Nasal/canvas/api.nas, line 103
  called from: /usr/local/share/FlightGear/data/Nasal/canvas/api.nas, line 228
  called from: /usr/local/share/FlightGear/data/Aircraft/F-20/Nasal/DDI/HSI.nas, line 93
  called from: /usr/local/share/FlightGear/data/Aircraft/F-20/Nasal/f-20.nas, line 74


The input data in the HSI.nas was not a NaN (it is a rotation angle in radians equal to 3.66).

I've seen in this thread that this kind of bugs happen but no clue as how to solve it. Any hint is welcome.

Cheers

Enrique
Flying toaster
 
Posts: 353
Joined: Wed Nov 29, 2006 6:25 am
Location: Toulouse France

PreviousNext

Return to Aircraft

Who is online

Users browsing this forum: No registered users and 2 guests