Board index FlightGear Development Aircraft

Eurocopter EC-145 current downloads

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

Re: Eurocopter EC-145 current downloads

Postby Thorsten » Wed Aug 22, 2018 5:57 am

Next to ALS shadows I added a "dust effect" on the MDF screens that is shown depending on ambient illumination level and relative sun angle.


How? This could be added to the glass or the display shader to be more widely available.
Thorsten
 
Posts: 9994
Joined: Mon Nov 02, 2009 8:33 am

Re: Eurocopter EC-145 current downloads

Postby litzi » Wed Aug 22, 2018 3:47 pm

Thorsten,

you found the "weak" point ;-)!

The panels are made of "old fashioned" 2D panel technology, thus the ALS effects cannot be applied to them, as far as I understand it. So it's kind of "handcrafted" as a semi-transparent layer in the 2D panel, switched by a sun-angle condition.

Thought of putting some "glass" on top in the 3D model of the bezel to allow ALS effects, but 2D panels magically overlay all other 3D objects (results in some nasty effects with the fuselage also). I am aware of Canvas, but I started with this activity way ago. I read that there is some idea to wrap 2D XML panel code for display under the Canvas framework, but it seems not to be available right now.

litzi
litzi
 
Posts: 52
Joined: Sat May 03, 2014 8:59 pm
Location: AT
Version: 2018.1.1
OS: Ubuntu 14.04

Re: Eurocopter EC-145 current downloads

Postby Thorsten » Wed Aug 22, 2018 5:34 pm

thus the ALS effects cannot be applied to them, as far as I understand it. So it's kind of "handcrafted" as a semi-transparent layer in the 2D panel, switched by a sun-angle condition.



Okay...

I suppose one can add it to the ALS glass effect in any case, it's not difficult to do and a good idea. Do you happen to have the overlay texture properly licensed?
Thorsten
 
Posts: 9994
Joined: Mon Nov 02, 2009 8:33 am

Re: Eurocopter EC-145 current downloads

Postby litzi » Thu Aug 23, 2018 5:05 am

I am happy to share the texture file if you can make good use it. It's my own "artwork" in the very sense, you can find my own fingerprints on it.. (photo taken off my cars dirty 'MFD' screen, to be precise)

I guess you refer to GPL license? Do you need something like a written statement provided together with the texture file?
litzi
 
Posts: 52
Joined: Sat May 03, 2014 8:59 pm
Location: AT
Version: 2018.1.1
OS: Ubuntu 14.04

Re: Eurocopter EC-145 current downloads

Postby Thorsten » Thu Aug 23, 2018 5:36 am

If you send me an email to thorsten@science-and-fiction.org with the file and state in there that you're licensing the file under GPL 2.0+, that'd be quite sufficient.

Thanks!
Thorsten
 
Posts: 9994
Joined: Mon Nov 02, 2009 8:33 am

Re: Eurocopter EC-145 current downloads

Postby Talkless » Sat Aug 25, 2018 10:51 am

Please add note how to lower/raise winch man in "Airfcarft Help". I see in ec145-set.xml that it's "m" and "M", but it would be nice to figure it out in Aircraft Help menu, instead of scanning xml :) .
Talkless
 
Posts: 80
Joined: Thu Mar 10, 2011 12:05 pm
Callsign: TLS
Version: git master
OS: Linux

Re: Eurocopter EC-145 current downloads

Postby Thorsten » Sat Aug 25, 2018 11:39 am

I am happy to share the texture file if you can make good use it.


I suspect I can - here's the display shader crunching it...

Image

Thanks a lot!
Thorsten
 
Posts: 9994
Joined: Mon Nov 02, 2009 8:33 am

Re: Eurocopter EC-145 current downloads

Postby StuartC » Sat Aug 25, 2018 3:24 pm

Talkless wrote in Sat Aug 25, 2018 10:51 am:Please add note how to lower/raise winch man in "Airfcarft Help". I see in ec145-set.xml that it's "m" and "M", but it would be nice to figure it out in Aircraft Help menu, instead of scanning xml :) .


I will add it for the next release. No idea when that will be yet, but It will have it.
StuartC
 
Posts: 2601
Joined: Fri Jun 18, 2010 8:18 pm
Location: Arse end of the Universe
Callsign: WF01
Version: 2.12
OS: W7 64 bit

Re: Eurocopter EC-145 current downloads

Postby litzi » Tue Oct 09, 2018 5:57 pm

Stuart,

see the link for the new files related to the shadow effects below. For some of the necessary changes I added just the new lines as code snippets below, because other changes I made to those files might be incompatible with your ec145 code.

https://www.dropbox.com/s/7256ccw7vsqqe ... s.zip?dl=0

A brief explaination to all those new files:

The ALS shadow effect consists of

1. the cube-map images in Models/Effects/cubemap
2. the new *.eff effect files in Models/Effects
3. the call to the effect files in the respective 3D model files Models/EC-145.xml (for interior, panel and glareshield) and Models/instruments/EUcopter-mfd/mfd*.xml : mfd0.xml, mfd1.xml, mfd2.xml (for the MFD bezel. Note: mfd3.xml does not have it, as its not installed in the ec145 cockpit.)

in EC-145.xml add:

Code: Select all
<!-- interior shadows on glareshield and interior fuselage-->
<effect>
  <inherits-from>Aircraft/ec145/Models/Effects/bk117interior-shadows</inherits-from>
  <object-name>seat1</object-name>
  <object-name>seat2</object-name>
  <object-name>floor</object-name>
  <object-name>intFrontdoorL</object-name>
  <object-name>intFrontdoorR</object-name>
  <object-name>stickleather</object-name>
  <object-name>stickleather.001</object-name>
  <object-name>interior</object-name>
  <object-name>fuselage.004</object-name>
  <object-name>fuselage.005</object-name>     
</effect>

<!--glareshield-->
<effect>
  <inherits-from>Aircraft/ec145/Models/Effects/bk117glaresh-shadows</inherits-from>
  <object-name>444</object-name>     
</effect>

<!-- interior shadows on main instrument panel -->
<effect>
  <inherits-from>Aircraft/ec145/Models/Effects/bk117panel-shadows</inherits-from>
  <object-name>panel</object-name>
</effect>


in the individual mfd*.xml files from mfd0.xml to mfd2.xml (note this contains shadow as well as the implicit lightmap) add (Note: mfd0 needs to be replaced by mfd1, mfd2 according to the individual file):

Code: Select all
<!-- ALS implicit lightmap for MFD bezel -->
<effect>
    <inherits-from>Aircraft/ec145/Models/Effects/mfd0-lightmap</inherits-from>
    <object-name>xmfdbezel</object-name>
</effect>   


The screen dust-effect needs:

1. new texture files Models/instruments/EUcopter-mfd/mfd.png and Models/instruments/EUcopter-mfd/Textures/dust-effect.rgb
2. a new instrument file Models/instruments/EUcopter-mfd/XML/dust-effect.xml
3. and inclusion of this instrument file at the end of the 4 panel definitions residing in /EUcopter-mfd/Panels/:
EUcopter-vmd-panel.xml, EUcopter-fnd-panel.xml, EUcopter-navd-panel.xml, EUcopter-dmap-panel.xml

Code: Select all
<instrument include="../XML/dust-effect.xml"/>


4. a Nasal timer function object to periodically compute the sun angle and light intensity on the panel to control the dust-effect, to be included e.g. in Nasal/bk117.nas

Code: Select all
var sun = {
 init: func () {
      me.sun = "sim/model/sun-on-panel";
      me.sun_angle = "sim/time/sun-angle-rad";
      me.timeh = "sim/time/local-day-seconds";
      me.head = "orientation/heading-deg";
      setprop(me.sun, 0);

      me.r = "rendering/scene/ambient/red";
      me.g = "rendering/scene/ambient/green";
      me.b = "rendering/scene/ambient/blue";
      settimer(func me.update(),0.2);
 },

 update: func () {
      var x = getprop(me.sun_angle);
      var heading = getprop(me.head);
      var pitch = 0; #todo: include pitch in calc.
     
      # very simple sun direction estimation
      var time = getprop(me.timeh)/3600;
      var sundir = time / 24 * 360;
      var sunang = x / math.pi*180;

      var relsundir = math.abs(heading - sundir);
      var relsunang = math.abs(pitch - sunang);
     
      var illum = ( getprop(me.r)+getprop(me.g)+getprop(me.b) )/3;
     
      var out = ((illum > 0.3) and (relsundir > 90) and (relsunang > 10 and relsunang < 70));
      setprop( me.sun, out);
      settimer(func me.update(),0.2);
    }
};
       
sun.init();     
Last edited by litzi on Fri Oct 12, 2018 3:40 pm, edited 1 time in total.
litzi
 
Posts: 52
Joined: Sat May 03, 2014 8:59 pm
Location: AT
Version: 2018.1.1
OS: Ubuntu 14.04

Re: Eurocopter EC-145 current downloads

Postby StuartC » Tue Oct 09, 2018 6:40 pm

Great, got it downloaded.

Only having an issue with the Nasal as the nasal file fails when this is inserted. Im not a nasal person.
StuartC
 
Posts: 2601
Joined: Fri Jun 18, 2010 8:18 pm
Location: Arse end of the Universe
Callsign: WF01
Version: 2.12
OS: W7 64 bit

Re: Eurocopter EC-145 current downloads

Postby litzi » Tue Oct 09, 2018 7:08 pm

The bk117.nas I am using had the "sun_angle" property object already defined in the begin of the script. If this is missing in the script you are inserting this, the script will fail. Most probably this is what you encounter.

I can provide a version that has a local copy of the sun_angle prop. object a bit later this week.
litzi
 
Posts: 52
Joined: Sat May 03, 2014 8:59 pm
Location: AT
Version: 2018.1.1
OS: Ubuntu 14.04

Re: Eurocopter EC-145 current downloads

Postby StuartC » Tue Oct 09, 2018 8:02 pm

that would be best as the bk117.nas fails wherever I put that code.
StuartC
 
Posts: 2601
Joined: Fri Jun 18, 2010 8:18 pm
Location: Arse end of the Universe
Callsign: WF01
Version: 2.12
OS: W7 64 bit

Re: Eurocopter EC-145 current downloads

Postby litzi » Fri Oct 12, 2018 3:43 pm

I revised that code to make it (almost) independent of external functions/elements (dependency on Nasal math lib can hardly be avoided). See original post. Hope that helps.
litzi
 
Posts: 52
Joined: Sat May 03, 2014 8:59 pm
Location: AT
Version: 2018.1.1
OS: Ubuntu 14.04

Re: Eurocopter EC-145 current downloads

Postby StuartC » Fri Oct 12, 2018 7:45 pm

which bit did you change ?
StuartC
 
Posts: 2601
Joined: Fri Jun 18, 2010 8:18 pm
Location: Arse end of the Universe
Callsign: WF01
Version: 2.12
OS: W7 64 bit

Re: Eurocopter EC-145 current downloads

Postby litzi » Fri Oct 12, 2018 8:05 pm

The Nasal timer function object, just replace the whole "sun"-object's code.
litzi
 
Posts: 52
Joined: Sat May 03, 2014 8:59 pm
Location: AT
Version: 2018.1.1
OS: Ubuntu 14.04

PreviousNext

Return to Aircraft

Who is online

Users browsing this forum: Exabot [Bot] and 6 guests