Board index FlightGear Development Effects and shaders

reflective aircraft body?

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

reflective aircraft body?

Postby D-ECHO » Tue Aug 09, 2016 11:57 am

Hi!
I have a little question about aircraft effects: Is there any realistic way to simulate the white-reflective paint on a usual aircraft body. Or is there any aircraft having such a configuration? I've tried many model-combined configurations but I couldn't find a one that looks good.
Regards
[EDIT]And how to activate the enviroment/cubemap
Code: Select all
<!-- Reflection environment -->
      <texture n="5">
         <type>cubemap</type>
         <!-- use this form for a cube cross -->
         <!--<image>Aircraft/Generic/Effects/CubeCrosses/blue_sky_big.jpg</image>-->
         <!-- END CubeCross -->
         <!-- use this form for a 6 image cube map -->
         <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>
         <!-- END 6 image cube map -->
      </texture>

I only see where to add the map, but is there any value to adjust so it is activated (or a factor)?
User avatar
D-ECHO
 
Posts: 1351
Joined: Sat May 09, 2015 12:31 pm

Re: reflective aircraft body?

Postby ausdkunst » Tue Aug 09, 2016 12:35 pm

HAHAH do you also have the problem of white turning gray, light green turning dark green etc?
BULLDOG RS (The No.1 place for Flightgear automobile): https://bulldogrs.wordpress.com/
User avatar
ausdkunst
 
Posts: 343
Joined: Fri Aug 28, 2015 9:47 am
Callsign: bulldog
Version: 2016.2.1
OS: Mac OS X

Re: reflective aircraft body?

Postby D-ECHO » Tue Aug 09, 2016 12:42 pm

Yep, I'd like to have something around this:
Image
You see the reflection? It doesn't have to be dynamic, it can also be a static environment map, but I couldn't find a configuration to get this :(
User avatar
D-ECHO
 
Posts: 1351
Joined: Sat May 09, 2015 12:31 pm

Re: reflective aircraft body?

Postby Thorsten » Tue Aug 09, 2016 2:10 pm

Yes, that should be possible. A combination of a high specular channel combined with a weak environment reflection using model-combined-deferred.eff ought to do it. What's the problem you're seeing?
Thorsten
 
Posts: 9804
Joined: Mon Nov 02, 2009 8:33 am

Re: reflective aircraft body?

Postby D-ECHO » Tue Aug 09, 2016 2:50 pm

For example my problem is how to factor the environment reflection?
[EDIT]The effect I use is
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<PropertyList>
    <name>skin_reflect</name>
    <inherits-from>Effects/model-combined-deferred</inherits-from>
    <parameters>
        <normalmap-enabled type="int">0</normalmap-enabled>
        <reflection-enabled type="int">1</reflection-enabled>
        <reflection-dynamic type="int">1</reflection-dynamic>
        <reflect_map-enabled type="int">0</reflect_map-enabled>
        <reflection-correction type="float">0.1</reflection-correction>
 <!--       <lightmap-enabled type="int">1</lightmap-enabled>
        <lightmap-multi type="int">1</lightmap-multi>
        <lightmap-factor type="float" n="0"><use>systems/electrical/outputs/logo-lights</use></lightmap-factor>
        <lightmap-color type="vec3d" n="0">0.07 0.07 0.07</lightmap-color>
        <lightmap-factor type="float" n="1"><use>controls/lighting/landing-lights</use></lightmap-factor>
        <lightmap-color type="vec3d" n="1">0.07 0.07 0.07</lightmap-color>
        <lightmap-factor type="float" n="2"><use>systems/electrical/outputs/beacon</use></lightmap-factor>
        <lightmap-color type="vec3d" n="2">0.07 0.00 0.00</lightmap-color>
        <lightmap-factor type="float" n="3">0.0</lightmap-factor>
        <lightmap-color type="vec3d" n="3">1.0 1.0 1.0</lightmap-color>
        <texture n="3">
            <image>Aircraft/757-200/Models/Effects/lightmap-F.png</image>
            <filter>linear-mipmap-linear</filter>
            <wrap-s>clamp</wrap-s>
            <wrap-t>clamp</wrap-t>
            <internal-format>normalized</internal-format>
        </texture>-->
        <texture n="5">
            <type>cubemap</type>
            <images>
                <positive-x>Aircraft/Generic/Effects/fgfs-sky2/1.png</positive-x>
                <negative-x>Aircraft/Generic/Effects/fgfs-sky2/4.png</negative-x>
                <positive-y>Aircraft/Generic/Effects/fgfs-sky2/2.png</positive-y>
                <negative-y>Aircraft/Generic/Effects/fgfs-sky2/3.png</negative-y>
                <positive-z>Aircraft/Generic/Effects/fgfs-sky2/6.png</positive-z>
                <negative-z>Aircraft/Generic/Effects/fgfs-sky2/5.png</negative-z>
            </images>
        </texture>
                <reflection-rainbow type="float">0.05</reflection-rainbow>
                <reflection-fresnel type="float">0.1</reflection-fresnel>
        <ambient_correction>0.1</ambient_correction>
    </parameters>
</PropertyList>

and I get a result of this:
Image
but unfortunately I see no reflection of the cubemap
User avatar
D-ECHO
 
Posts: 1351
Joined: Sat May 09, 2015 12:31 pm

Re: reflective aircraft body?

Postby Thorsten » Tue Aug 09, 2016 5:15 pm

but unfortunately I see no reflection of the cubemap


I hate to point out the obvious but...

Code: Select all
 <reflect_map-enabled type="int">0</reflect_map-enabled>


first, you tried to disable it, second, it's called <reflect-map-enabled> (minus rather than underscore), so you didn't actually disable it but it's still off by default.
Thorsten
 
Posts: 9804
Joined: Mon Nov 02, 2009 8:33 am

Re: reflective aircraft body?

Postby D-ECHO » Tue Aug 09, 2016 6:19 pm

So I have to set it to 1?
User avatar
D-ECHO
 
Posts: 1351
Joined: Sat May 09, 2015 12:31 pm

Re: reflective aircraft body?

Postby Thorsten » Tue Aug 09, 2016 6:22 pm

You have to set the correctly named property to 1 for the relevant shader block to be executed, yes. I didn't check whether everything else was valid though.
Thorsten
 
Posts: 9804
Joined: Mon Nov 02, 2009 8:33 am

Re: reflective aircraft body?

Postby D-ECHO » Tue Aug 09, 2016 6:46 pm

Okay thank you I messed up grey and reflection Map. Thanks!;-)
User avatar
D-ECHO
 
Posts: 1351
Joined: Sat May 09, 2015 12:31 pm

Re: reflective aircraft body?

Postby ausdkunst » Tue Aug 09, 2016 6:50 pm

@D-ECHO please post up a screenshot because I want to know how it goes :)
BULLDOG RS (The No.1 place for Flightgear automobile): https://bulldogrs.wordpress.com/
User avatar
ausdkunst
 
Posts: 343
Joined: Fri Aug 28, 2015 9:47 am
Callsign: bulldog
Version: 2016.2.1
OS: Mac OS X

Re: reflective aircraft body?

Postby D-ECHO » Tue Aug 09, 2016 7:32 pm

This is how it's looking atm. pretty neat but I need to find a way to make it much more white ;)
Image
User avatar
D-ECHO
 
Posts: 1351
Joined: Sat May 09, 2015 12:31 pm

Re: reflective aircraft body?

Postby D-ECHO » Wed Aug 10, 2016 4:33 am

Okay, I tried a lot with different values, but I can't get it to be brighter than this
Image
with this code:
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<PropertyList>
    <name>skin_reflect</name>
    <inherits-from>Effects/model-combined-deferred</inherits-from>
    <parameters>
        <normalmap-enabled type="int">0</normalmap-enabled>
        <reflection-enabled type="int">1</reflection-enabled>
        <reflection-dynamic type="int">0.1</reflection-dynamic>
        <reflect-map-enabled type="int">0.000001 </reflect-map-enabled>
        <reflection-correction type="float">0.00001</reflection-correction>
 <!--       <lightmap-enabled type="int">1</lightmap-enabled>
        <lightmap-multi type="int">1</lightmap-multi>
        <lightmap-factor type="float" n="0"><use>systems/electrical/outputs/logo-lights</use></lightmap-factor>
        <lightmap-color type="vec3d" n="0">0.07 0.07 0.07</lightmap-color>
        <lightmap-factor type="float" n="1"><use>controls/lighting/landing-lights</use></lightmap-factor>
        <lightmap-color type="vec3d" n="1">0.07 0.07 0.07</lightmap-color>
        <lightmap-factor type="float" n="2"><use>systems/electrical/outputs/beacon</use></lightmap-factor>
        <lightmap-color type="vec3d" n="2">0.07 0.00 0.00</lightmap-color>
        <lightmap-factor type="float" n="3">0.0</lightmap-factor>
        <lightmap-color type="vec3d" n="3">1.0 1.0 1.0</lightmap-color>
        <texture n="3">
            <image>Aircraft/757-200/Models/Effects/lightmap-F.png</image>
            <filter>linear-mipmap-linear</filter>
            <wrap-s>clamp</wrap-s>
            <wrap-t>clamp</wrap-t>
            <internal-format>normalized</internal-format>
        </texture>-->
        <texture n="4">
         <image>Flugzeuge/CSeries/Models/Effects/greymap.png</image>
         <type>2d</type>
         <filter>linear-mipmap-linear</filter>
         <wrap-s>clamp</wrap-s>
         <wrap-t>clamp</wrap-t>
         <internal-format>normalized</internal-format>
      </texture>
        <texture n="5">
            <type>cubemap</type>
            <images>
                <positive-x>Aircraft/Generic/Effects/CubeMaps/real.fair-sky/fair-sky_px.png</positive-x>
                <negative-x>Aircraft/Generic/Effects/CubeMaps/real.fair-sky/fair-sky_nx.png</negative-x>
                <positive-y>Aircraft/Generic/Effects/CubeMaps/real.fair-sky/fair-sky_py.png</positive-y>
                <negative-y>Aircraft/Generic/Effects/CubeMaps/real.fair-sky/fair-sky_ny.png</negative-y>
                <positive-z>Aircraft/Generic/Effects/CubeMaps/real.fair-sky/fair-sky_pz.png</positive-z>
                <negative-z>Aircraft/Generic/Effects/CubeMaps/real.fair-sky/fair-sky_nz.png</negative-z>
            </images>
        </texture>
                <reflection-rainbow type="float">0.1</reflection-rainbow>
                <reflection-fresnel type="float">0.5</reflection-fresnel>
        <ambient_correction>100</ambient_correction>
    </parameters>
</PropertyList>

Somehow, it seems to me the greymap isn't correctly read as, no matter whether I have it full black or full white, it looks the same. @Thorsten, could you help? ;)
User avatar
D-ECHO
 
Posts: 1351
Joined: Sat May 09, 2015 12:31 pm

Re: reflective aircraft body?

Postby Thorsten » Wed Aug 10, 2016 6:36 am

Code: Select all
<reflection-dynamic type="int">0.1</reflection-dynamic>
        <reflect-map-enabled type="int">0.000001 </reflect-map-enabled>


Seriously?

These are integer on/off flags, god knows what happens if you set them to floating point values.

What grey map by the way?

Did you try the documentation of the effect? It's a complicated beast in which the channels all have to follow a certain convention and flags have some mutual dependency. For instance, if you specify four lightmap channels but leave the lightmap flag to off, you're not getting any because lightmap channel function requires lightmap on. If you request any normal map but don't supply tangent and binormal vectors, you get a dark aircraft (or worse, a crash).
Thorsten
 
Posts: 9804
Joined: Mon Nov 02, 2009 8:33 am

Re: reflective aircraft body?

Postby Necolatis » Wed Aug 10, 2016 6:54 am

"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore


Hangar: https://sites.google.com/site/fghangar/
User avatar
Necolatis
 
Posts: 1857
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2018.2.2
OS: Windows 10 Pro

Re: reflective aircraft body?

Postby D-ECHO » Wed Aug 10, 2016 7:40 am

Thank you!!
So I set everything accordingly to the docu:
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<PropertyList>
    <name>skin_reflect</name>
    <inherits-from>Effects/model-combined-deferred</inherits-from>
    <parameters>
        <normalmap-enabled type="int">0</normalmap-enabled>
        <reflection-enabled type="int">1</reflection-enabled>
        <reflection-dynamic type="int">1</reflection-dynamic>
        <reflect-map-enabled type="int">0 </reflect-map-enabled>
        <reflection-correction type="float">0</reflection-correction>
        <texture n="4">
         <image>Flugzeuge/CSeries/Models/Effects/greymap.png</image>
         <type>2d</type>
         <filter>linear-mipmap-linear</filter>
         <wrap-s>clamp</wrap-s>
         <wrap-t>clamp</wrap-t>
         <internal-format>normalized</internal-format>
      </texture>
        <texture n="5">
            <type>cubemap</type>
            <images>
                <positive-x>Aircraft/Generic/Effects/CubeMaps/real.fair-sky/fair-sky_px.png</positive-x>
                <negative-x>Aircraft/Generic/Effects/CubeMaps/real.fair-sky/fair-sky_nx.png</negative-x>
                <positive-y>Aircraft/Generic/Effects/CubeMaps/real.fair-sky/fair-sky_py.png</positive-y>
                <negative-y>Aircraft/Generic/Effects/CubeMaps/real.fair-sky/fair-sky_ny.png</negative-y>
                <positive-z>Aircraft/Generic/Effects/CubeMaps/real.fair-sky/fair-sky_pz.png</positive-z>
                <negative-z>Aircraft/Generic/Effects/CubeMaps/real.fair-sky/fair-sky_nz.png</negative-z>
            </images>
        </texture>
                <reflection-rainbow type="float">0.1</reflection-rainbow>
                <reflection-fresnel type="float">-1</reflection-fresnel>
        <ambient-correction>0.5</ambient-correction>
    </parameters>
</PropertyList>

Now it's reflective and somewhat bright, but it's a bit blue-greenish, is there a possibility for a color-correction inside the effect?
Image
User avatar
D-ECHO
 
Posts: 1351
Joined: Sat May 09, 2015 12:31 pm

Next

Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 2 guests