Board index FlightGear Development Effects and shaders

ALS display effect reversed?

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

ALS display effect reversed?

Postby litzi » Sun Feb 24, 2019 8:08 pm

Image

I employed ALS display shader on a Canvas screen and for me the result seems now to be reversed with respect to what the Shuttle example in the wiki page in the ALS technical notes shows?

The sunlit parts of the screen have a stronly increased contrast while the shaded parts show a flat contrast. Is this not exactly opposite as expected?

Code below, did I do anything wrong to the shader parameters?

Code: Select all
<PropertyList>
    <!-- display shader effect common parts -->
    <opacity-cube-scale type="vec3d" n="0">0.25 0.25 0.25</opacity-cube-scale>
    <opacity-cube-angle type="float">14.0</opacity-cube-angle>
    <sample-res>0.0004</sample-res>
    <dirt-factor>0.9</dirt-factor>
    <contrast>0.5</contrast>   

    <texture n="4">
        <type>cubemap</type>
        <images>
            <positive-x>Aircraft/ec145/Models/Effects/cubemap/shdw-map-px.png</positive-x>
            <negative-x>Aircraft/ec145/Models/Effects/cubemap/shdw-map-nx-panel.png</negative-x>
            <positive-y>Aircraft/ec145/Models/Effects/cubemap/shdw-map-py-panel.png</positive-y>
            <negative-y>Aircraft/ec145/Models/Effects/cubemap/shdw-map-ny-panel.png</negative-y>
            <positive-z>Aircraft/ec145/Models/Effects/cubemap/shdw-map-pz-panel.png</positive-z>
            <negative-z>Aircraft/ec145/Models/Effects/cubemap/shdw-map-nz.png</negative-z>
        </images>
      </texture>

    <texture n="5">
            <type>2d</type>
            <filter>linear-mipmap-linear</filter>
            <wrap-s>clamp</wrap-s>
            <wrap-t>clamp</wrap-t>
            <internal-format>normalized</internal-format>
            <image>Aircraft/Generic/Effects/dust-effect-overlay.png</image>
    </texture>

</PropertyList>


Note that the cubemap center is defined elsewhere.

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

Re: ALS display effect reversed?

Postby wlbragg » Sun Feb 24, 2019 8:35 pm

Yes, but look at the left MFD VS the right MFD? Those look correct, yes?
No, I guess they don't, my mind had it backwards!

Are you using a background? can you post the material setting of both the display screen and the background if any?
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4685
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: ALS display effect reversed?

Postby litzi » Mon Feb 25, 2019 9:05 pm

yes, there is a material assigned to the screen object. I included this to make the screen emissive in the dark. To what to you refer to as the "background"?

Code: Select all
<!-- ALS display effect for the MFD screen object , needs FG 2018.3+-->
<effect>
      <inherits-from>Effects/mfd0-screen</inherits-from>
      <object-name>xmfd0screen</object-name>
</effect>

<animation>
    <type>material</type>
    <object-name>xmfd0screen</object-name>
    <emission>
      <red>1.0</red>
      <green>1.0</green>
      <blue>1.0</blue>
    </emission>   
</animation>
litzi
 
Posts: 69
Joined: Sat May 03, 2014 8:59 pm
Location: AT
Version: 2018.3.1
OS: Ubuntu 14.04

Re: ALS display effect reversed?

Postby wlbragg » Mon Feb 25, 2019 9:49 pm

In the Shuttle's use of the dirt effect and the shadow cube the MFD's have a background object behind the MDF object. The material settings I am referring to are the ones in the .ac file assigned to the MFD object and/or the background object.
I don't know if the background object or the material settings have anything to do with it for sure, but it's something I would look at.
Have you tried removing the material animation you apply to the object to see if that makes a difference?
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4685
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: ALS display effect reversed?

Postby wlbragg » Mon Feb 25, 2019 10:22 pm

Background
Image

MATERIAL "FwdCockpit" rgb 0.800 0.800 0.800 amb 1.000 1.000 1.000 emis 0.000 0.000 0.000 spec 0.060 0.060 0.060 shi 12 trans 0.000

Hudglass
Image

MATERIAL "hud-glass" rgb 0.800 0.800 0.800 amb 0.000 0.000 0.000 emis 0.000 0.000 0.000 spec 0.000 0.000 0.000 shi 50 trans 0.000
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4685
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: ALS display effect reversed?

Postby litzi » Thu Feb 28, 2019 6:47 am

No, this doesn't help. I assigned the same material properties to background and screen objects as in your example. The effect goes to the extreme, absolutely black where the sun is not falling onto (no display emission), visible screen where there is light. Exactly as you would expect from a REFLECTIVE display, not an EMISSIVE one. I also had a look at the shuttle code but didnt find anything obvious there.
litzi
 
Posts: 69
Joined: Sat May 03, 2014 8:59 pm
Location: AT
Version: 2018.3.1
OS: Ubuntu 14.04

Re: ALS display effect reversed?

Postby Thorsten » Thu Feb 28, 2019 8:55 am

Flipped normals? That usually reverses lighting as compared to what you expect.
Thorsten
 
Posts: 10639
Joined: Mon Nov 02, 2009 8:33 am

Re: ALS display effect reversed?

Postby wlbragg » Thu Feb 28, 2019 9:23 pm

No, this doesn't help.

Did you try it after remove the xml material animation you assigned?

Absolutely, check the normals!
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4685
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: ALS display effect reversed?

Postby wlbragg » Thu Feb 28, 2019 9:27 pm

Two things I notice that may be unrelated.

No opacity-cube-center tag.
Why opacity-cube-angle = 14?
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4685
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: ALS display effect reversed?

Postby litzi » Fri Mar 01, 2019 6:18 am

Thank you all for your assistance, so

- I checked the normals in Blender and they point outwards to the observer, so Ok
- yes, for the above mentioned test all material animations were removed from the model XML file
- cube center is defined in a higher level per-screen model file, the code above holds the (via include=..) common parameters for all 3 MFDs
- the MFDs are child models to the cockpit model. As panel and MFDs are tilted w.r.t. the main model I have tilted the cube to account for that

As for the shadow: you can see the the shadow cast on the screen itself seems correct (the shadow edge on "dust" following the edge cast on the bezel), but the blur and contrast effects on the Canvas seem to be reversed.
litzi
 
Posts: 69
Joined: Sat May 03, 2014 8:59 pm
Location: AT
Version: 2018.3.1
OS: Ubuntu 14.04

Re: ALS display effect reversed?

Postby wlbragg » Fri Mar 01, 2019 6:34 am

I need to see the code in its entirety as I am out of ideas with the available info.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4685
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640


Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 1 guest