Board index FlightGear Development Effects and shaders

Model-interior effect - tuning

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

Model-interior effect - tuning

Postby legoboyvdlp » Fri May 08, 2020 1:39 pm

Hello,

I've been adding the extended model-interior effect features to the A320.

Image

I kind of feel this is a bit too dark when there isn't direct sun. Shouldn't the indirect light of the sky also cause an effect, not only the direct light of the sun?

What I feel is missing is the shadow formed from "indirect" lighting.

Maybe I configured it wrong. Particularly, the irradiance - not sure if I did that quite right.

My .eff file is as follows:
https://pastebin.com/wPruW5VF

Also, is there potential to add shadows from cockpit lighting as well (e.g. by baking shadow maps from those lights, and applying them to the effect with a factor controlled by the lighting control)?

Edit - Thank you to Necolatis for pointing out that I was wrong about the indirect lighting.
User avatar
legoboyvdlp
 
Posts: 7705
Joined: Sat Jul 26, 2014 1:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: Model-interior effect - tuning

Postby wlbragg » Fri May 08, 2020 4:00 pm

by baking shadow maps from those lights, and applying them to the effect with a factor controlled by the lighting control

Yes, they're in both the Shuttle and the c172p for examples. If you have multiple lights use lightmap-mult

As far as what to expect for "indirect" lighting, I don't know.

The c172p is ultra complex because we allowed for some fairly sophisticated lighting in systems still not using ALS and because of the light maps. It gets really gnarly when you add light maps as an after thought, when the entire effects framework evolve after the initial layout concepts for the models used were effected. Multiply the complexity by the number of parts that have separate origins. 3 files for each individual instrument just for the light maps. It adds up.

That is one thing I think is really missing in our documentation, how aircraft parts need to be laid out in the beginning. I think you would get a big argument if you tried to suggest doing it one way over another, because there are advantages and disadvantages to the different ways it can be done. But for effects, it needs to be one way or you add unnecessary layers of complexity to the effects layout.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 5642
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: Model-interior effect - tuning

Postby legoboyvdlp » Fri May 08, 2020 4:13 pm

I set the irradiance to 0.01 rather than 0.1 and it did make it a bit brighter.

Image

I am beginning to think the texture itself might be too dark.
I've checked material, and amb in all of them is set to 0.8 or 1.0. I can try bumping it to 1.0 on all of them.


The main problem is the main instrument panel (the one with all the displays!). It's the one that's darkest.
User avatar
legoboyvdlp
 
Posts: 7705
Joined: Sat Jul 26, 2014 1:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: Model-interior effect - tuning

Postby wlbragg » Fri May 08, 2020 4:19 pm

Definitely a delicate balance between the texture material setting and the lighting.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 5642
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: Model-interior effect - tuning

Postby legoboyvdlp » Fri May 08, 2020 5:51 pm

What I don't quite get is the difference here:

Image

Image

Everything else is the same; one has a transparent cubemap, one does not.
Surely it shouldn't be so dark?
User avatar
legoboyvdlp
 
Posts: 7705
Joined: Sat Jul 26, 2014 1:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: Model-interior effect - tuning

Postby Thorsten » Fri May 08, 2020 5:55 pm

The alpha channel of the cube map only does caustics - I believe you want a white opacity map rather than a transparent one.
Thorsten
 
Posts: 11680
Joined: Mon Nov 02, 2009 8:33 am

Re: Model-interior effect - tuning

Postby legoboyvdlp » Fri May 08, 2020 6:05 pm

Yep, but I also would like shadows at the same time without this excessive darkness :-)

Maybe I'm wrong, but I'm pretty sure the cockpit isn't that dark.
User avatar
legoboyvdlp
 
Posts: 7705
Joined: Sat Jul 26, 2014 1:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: Model-interior effect - tuning

Postby Thorsten » Sat May 09, 2020 6:07 am

I'm not sure we're on the same page. When you speak about a cubemap with transparency, I assume you mean the opacity map with an alpha channel set. So I try to tell you that the content of the alpha channel is not what determines shadows - if you have a black opacity map which you made completely transparent, it's going to block light everywhere, because the opacity is encoded in the color channel.

So from the description I assumed that this might be your problem.

Otherwise the opacity map calculation removes all direct light (specular and diffuse) but leaves indirect light (ambient) as is. So If you're only applying an opacity map, you should see whatever the product of ambient light, ambient material color and texture color happens to be where the opacity map is opaque.

Now, the effect that runs the opacity map also contains provisions to run irradiance maps which change only indirect light, so it is possible that you changed something there which you did not intend.

It's difficult to see what you're trying to communicate when you post two pictures without any detailed explanation how they were made, where the light source is and as if one is too dark - I don't know what the intended visuals are, so I can't judge either way. Generally cockpits which previously have been 'open' to the lighting equations (i.e. always have shown full direct light) tend to get much darker if you only consider the light which actually falls through the windows of the plane.
Thorsten
 
Posts: 11680
Joined: Mon Nov 02, 2009 8:33 am

Re: Model-interior effect - tuning

Postby legoboyvdlp » Sat May 09, 2020 9:49 am

Yes, I think that was an error on my part. Sorry, I should have been specific that the first was with the placeholder (from the time at which I applied lightmaps). I took it from this:

A workaround is to create a pseudo cubemap by creating a white.png 64x64 square, and creating the following structure to represent a transparent cubemap
that the placeholder should be transparent. The current opacity map which replaces the placeholder has no transparency at all.

Also, to confirm that this isn't a cause, the ambient parameter in materials are now all 1. 1.0 1.0.

Regardless,
Now, the effect that runs the opacity map also contains provisions to run irradiance maps which change only indirect light, so it is possible that you changed something there which you did not intend.

That's quite possible! I found the best result with the irradiance parameter removed completely (i.e. type set to zero). It might not be so accurate, but then the Airbus cockpit having relatively large windows is very full of light Indeed.

Generally cockpits which previously have been 'open' to the lighting equations (i.e. always have shown full direct light) tend to get much darker if you only consider the light which actually falls through the windows of the plane.


I suppose that makes sense... it will just take getting used to then!
User avatar
legoboyvdlp
 
Posts: 7705
Joined: Sat Jul 26, 2014 1:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP


Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 1 guest