Board index FlightGear Development Effects and shaders

The ALS HUD shader and ALS-filters

An exciting "new" option in FlightGear, that includes reflections, lightmaps, the particle system etc.. A lot is yet to be discovered/implemented!

The ALS HUD shader and ALS-filters

Postby Necolatis » Sat Apr 15, 2017 11:27 pm

The shader looks really good, but I seem to have an issue with using ALS-filters at the same time.

Any help appreciated.

Here without ALS-filters:

Image

Here with filters (normal and default):

Image

The HUD has this material setting:

MATERIAL "hudMat" rgb 0.80 0.80 0.80 amb 0.00 0.00 0.00 emis 0.00 0.00 0.00 spec 0.00 0.00 0.00 shi 50 trans 0.10

Furthermore I have an material animation on it that turns emission to 1,1,1

This is the effect:

Code: Select all
<parameters>
  <glass-tint type="vec4d" n="0"> 0.95 1.0 0.95 1.0</glass-tint>
  <overlay-color type="vec3d" n="0"> 0.8 1.0 0.9</overlay-color>
  <splash-x>0</splash-x>
  <splash-y>0</splash-y>
  <splash-z>0</splash-z>
  <rnorm>0</rnorm>
  <gsnorm>0</gsnorm>
  <frost-level><use>/environment/aircraft-effects/frost-level</use></frost-level>
  <surface-mapping-scheme type="int">0</surface-mapping-scheme>
  <fog-level>0</fog-level>
  <use-wipers>0</use-wipers>
  <use-overlay><use>ja37/hud/overlay</use></use-overlay><!-- set to 1 -->
  <overlay-alpha type="float"><use>ja37/hud/overlay-alpha</use></overlay-alpha><!-- set to 0.35 -->
  <overlay-glare type="float"><use>ja37/hud/overlay-glare</use></overlay-glare><!-- set to 0.4 -->
  <use-reflection type="int">0</use-reflection>
  <reflection-strength type="float">1.0</reflection-strength>
  <use-mask type="int"><use>ja37/hud/mask</use></use-mask><!-- set to 1 -->
  <use-reflection-lightmap type="int">0</use-reflection-lightmap>
  <lightmap-multi type="int">0</lightmap-multi>
  <lightmap-factor type="float" n="0">1.0</lightmap-factor>
  <lightmap-color type="vec3d" n="0"> 1.0 1.0 1.0 </lightmap-color>
  <lightmap-factor type="float" n="1">1.0</lightmap-factor>
  <lightmap-color type="vec3d" n="1"> 1.0 1.0 1.0 </lightmap-color>
  <lightmap-factor type="float" n="2">1.0</lightmap-factor>
  <lightmap-color type="vec3d" n="2"> 1.0 1.0 1.0 </lightmap-color>
  <lightmap-factor type="float" n="3">1.0</lightmap-factor>
  <lightmap-color type="vec3d" n="3"> 1.0 1.0 1.0 </lightmap-color>
  <sample-res>0.0006</sample-res>
  <sample-far>2.5</sample-far>
  <brightness><use>ja37/hud/brightness</use></brightness><!-- set to 1 -->
   <texture n="1">
      <image>Aircraft/JA37/Models/Effects/frostAndRain/window_frost.png</image>
      <type>2d</type>
      <filter>linear-mipmap-linear</filter>
      <wrap-s>repeat</wrap-s>
      <wrap-t>repeat</wrap-t>
      <internal-format>normalized</internal-format>
   </texture>
   <!-- placeholder for the function texture used for fogging, wiper area,...-->
   <texture n="2">
      <image>Aircraft/JA37/Models/Effects/hud/hud-glass.rgb</image>
      <type>2d</type>
      <filter>linear-mipmap-linear</filter>
      <wrap-s>repeat</wrap-s>
      <wrap-t>repeat</wrap-t>
      <internal-format>normalized</internal-format>
   </texture>   
   <!-- texture for reflections in the glass -->
   <texture n="3">
      <type>cubemap</type>
      <images>
         <positive-x>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_px.png</positive-x>
         <negative-x>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_nx.png</negative-x>
         <positive-y>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_py.png</positive-y>
         <negative-y>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_ny.png</negative-y>
         <positive-z>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_pz.png</positive-z>
         <negative-z>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_nz.png</negative-z>
      </images>
      </texture>
   <!-- placeholder lightmap texture for reflections in the glass -->
   <texture n="4">
      <type>cubemap</type>
      <images>
         <positive-x>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_px.png</positive-x>
         <negative-x>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_nx.png</negative-x>
         <positive-y>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_py.png</positive-y>
         <negative-y>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_ny.png</negative-y>
         <positive-z>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_pz.png</positive-z>
         <negative-z>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_nz.png</negative-z>
      </images>
      </texture>
</parameters>


The Canvas settings:

Text color: 0,1,0
Background: 0,1,0,0

System:
FG 2017.2.0
Win 10
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2233
Joined: Mon Oct 29, 2012 1:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2020.3.19
OS: Windows 10

Re: The ALS HUD shader and ALS-filters

Postby Thorsten » Sun Apr 16, 2017 4:58 am

Hm, works fine for the Shuttle HUD (that's pretty much my only test case) - and it's clearly affected since it loses color in the IR cam. In fact, it looks like your second shot in the IR cam...

So to confirm, the HUD loses color whenever you enable filters, regardless of what filter you run?
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: The ALS HUD shader and ALS-filters

Postby Necolatis » Sun Apr 16, 2017 2:21 pm

Yes, except in infrared vision it works fine though, it gets a white color.

I also tried just using the stock HUD effect, and it gives same result.

Well, if it works in the shuttle I must have done something wrong, I will try to find out what.
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2233
Joined: Mon Oct 29, 2012 1:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2020.3.19
OS: Windows 10

Re: The ALS HUD shader and ALS-filters

Postby Necolatis » Tue Apr 18, 2017 6:08 am

I have the same issue in the shuttle, when setting /sim/config/shuttle/hud-filter=1. Is there anything else I have to do?

I am using the latest $fgdata and also tried clearing $fghome.
Used the latest dev-branch shuttle (orbit).

Btw. Really liked the displays and looking at earth through a window.
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2233
Joined: Mon Oct 29, 2012 1:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2020.3.19
OS: Windows 10

Re: The ALS HUD shader and ALS-filters

Postby Thorsten » Tue Apr 18, 2017 6:16 am

I'll have a look again - I'm on my devel setup, maybe there's something set in a subtly different way to FGData.

Conceptually this should be harmless as it's just a color filter, but it could be that there's a parameter not properly declared.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: The ALS HUD shader and ALS-filters

Postby Thorsten » Tue Apr 18, 2017 2:43 pm

I think I found it - subtle one... Please pull FGData and try again.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: The ALS HUD shader and ALS-filters

Postby Necolatis » Tue Apr 18, 2017 5:19 pm

Its works with filters now. Thank you.
:)
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2233
Joined: Mon Oct 29, 2012 1:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2020.3.19
OS: Windows 10

Re: The ALS HUD shader and ALS-filters

Postby Thorsten » Tue Apr 18, 2017 5:59 pm

Okay, good. Thanks for reporting.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am


Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 1 guest