Board index FlightGear Development Scenery

lightmaps for random buildings

Questions and discussion about enhancing and populating the FlightGear world.

Re: lightmaps for random buildings

Postby Volador » Fri Dec 02, 2022 9:02 pm

ok, I put Gabo's Compositor/Effects/buildings.eff (13Kb) in C:\Program Files\FlightGear 2020.4\data\Compositor\Effects (The Effects folder did not exist before). And I also put the same .eff file in C:\Program Files\FlightGear 2020.4\data\Effects
I have no (random) buildings :( ...I'm so confused
User avatar
Volador
 
Posts: 1142
Joined: Tue Sep 01, 2020 4:58 pm
Callsign: Volador, G-VLDR
Version: 2020.4
OS: Windows 10, 64 bit

Re: lightmaps for random buildings

Postby TheEagle » Fri Dec 02, 2022 10:54 pm

The effect files you linked are both only usable with 2020.3.*, because only that has the necessary file and folder structure - are you sure you didn't put the same file in two places in the repo ? :wink:
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3433
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: lightmaps for random buildings

Postby TheEagle » Sat Dec 03, 2022 3:27 am

No, you didn't - they are different, in fact ! But even the one in the Compositor folder doesn't work … do you think I could talk to Gabo directly somehow - does he have a forum account so we can PM ?
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3433
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: lightmaps for random buildings

Postby Volador » Sat Dec 03, 2022 9:08 am

Gabo has posted in this thread Eagle, (page 1 of the thread) he has other priorities recently as we had been communicating off-forum so you might not get a response. He's shown me his code working on 2020.3 with reflections and also lightmap. My role in all this is the texture bitmap update.
User avatar
Volador
 
Posts: 1142
Joined: Tue Sep 01, 2020 4:58 pm
Callsign: Volador, G-VLDR
Version: 2020.4
OS: Windows 10, 64 bit

Re: lightmaps for random buildings

Postby jam007 » Mon Dec 05, 2022 11:44 am

I tried to use the effect on a single building but it is invisible . No error messages when loading. But I must be doing something wrong:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>

<PropertyList>
    <path>ukk.ac</path>
 
<effect>
    <inherits-from>Effects/building</inherits-from>
   <object-name>Cube</object-name>
   <parameters>
       <texture n="0">
            <type>2d</type>
            <image>ukktex.png</image>
            <filter>linear-mipmap-linear</filter>
            <wrap-s>repeat</wrap-s>
            <wrap-t>clamp</wrap-t>
            <internal-format>normalized</internal-format>
       </texture>
       <!-- Normal Map -->
       <texture n="2">
         <image>Textures/buildings-normalmap_orig.png</image>
         <type>2d</type>
         <filter>linear-mipmap-linear</filter>
         <wrap-s>repeat</wrap-s>
         <wrap-t>clamp</wrap-t>
         <internal-format>normalized</internal-format>
      </texture>
       <!-- Light Map -->
       <texture n="3">
            <image>ukk-light.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>
    </parameters>
</effect>
   
</PropertyList>
jam007
 
Posts: 584
Joined: Sun Dec 16, 2012 11:04 am
Location: Uppsala, Sweden
Callsign: LOOP
Version: 2020.4.0
OS: Ubuntu 22.04

Re: lightmaps for random buildings

Postby TheEagle » Mon Dec 05, 2022 1:28 pm

This effect is a special one - it requires some parameters to be filled in by FG, and that is only done for the random buildings created on the fly by FG, so I doubt this has any chance of working ! :) But you can achieve the same light- and reflection mapping by inheriting directly from model-combined and setting the appropriate parameters.
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3433
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: lightmaps for random buildings

Postby jam007 » Mon Dec 05, 2022 6:38 pm

Ah!
jam007
 
Posts: 584
Joined: Sun Dec 16, 2012 11:04 am
Location: Uppsala, Sweden
Callsign: LOOP
Version: 2020.4.0
OS: Ubuntu 22.04

Re: lightmaps for random buildings

Postby Volador » Sat Apr 01, 2023 1:07 pm

Any shader guru's out there who'd like to look at getting the new random buildings textures working on Next? Status is that I have a new atlas for random buildings, a reflection map and a lightmap - so far, reflection maps blocked the windows lightmap at night but my skills are more the art rather than the code so I could really do with some help with the buildings.eff. TIA :D

New lightmap can be solid like this: or can be just the window areas - have tried both, this map below seems to make everything dark with no illumination but I think the reflection map is blocking the lit windows...
Image
Last edited by Volador on Mon Apr 03, 2023 3:57 pm, edited 1 time in total.
User avatar
Volador
 
Posts: 1142
Joined: Tue Sep 01, 2020 4:58 pm
Callsign: Volador, G-VLDR
Version: 2020.4
OS: Windows 10, 64 bit

Re: lightmaps for random buildings

Postby Fahim Dalvi » Mon Apr 03, 2023 9:56 am

Just a clarifying question, when you say that the "reflection map" blocks the "light map", does this happen only on the pixels where there is reflection, or just including a reflection map disables lightmap completely?
User avatar
Fahim Dalvi
 
Posts: 1353
Joined: Sun Oct 14, 2007 2:08 pm
Location: Qatar
Callsign: Fahim
Version: 2020.3.11
OS: macOS

Re: lightmaps for random buildings

Postby Volador » Mon Apr 03, 2023 3:43 pm

Hi Fahim, I've not been able to get any sort of lightmap working on Next so I'm not sure. @Gabo originally did some hack where the lightmap and reflection map were the same texture, so there was partial reflection and partial lightmap depending if it was day or night. He managed to get reflections working with a separate reflection map transparent png that just had window areas as pixels working on the last release by modifying the building.eff but he's had other stuff on and hasn't been able to look at getting it to work on Next.

If anyone needs the individual textures, the artwork I've produced has layers so I can easily export a lightmap as above (solid dark buildings and lit windows) or I can export a transparent with just the lit windows like this:
Image

I've also been reaching out to Fernando who's recently got back to me, I think he knows shaders but it would be great to get some combined minds to solve it. Here's what it currently looks like day and night (unmodified buildings.eff code on Next) , note that only non-random buildings have illuminated windows:

Daytime
Image

only non-random buildings have illuminated windows
Image
User avatar
Volador
 
Posts: 1142
Joined: Tue Sep 01, 2020 4:58 pm
Callsign: Volador, G-VLDR
Version: 2020.4
OS: Windows 10, 64 bit

Re: lightmaps for random buildings

Postby Gabo Huerta » Mon Apr 10, 2023 1:50 pm

Is this the result you want?

Image
Image
Image
Image
User avatar
Gabo Huerta
 
Posts: 23
Joined: Tue Sep 24, 2013 2:45 am
Location: Australia
Version: 2020.3
OS: Windows

Re: lightmaps for random buildings

Postby Volador » Mon Apr 10, 2023 3:33 pm

Result! Brilliant Gabo. Looking forward to getting my first (joint effort) commit to the project :D
User avatar
Volador
 
Posts: 1142
Joined: Tue Sep 01, 2020 4:58 pm
Callsign: Volador, G-VLDR
Version: 2020.4
OS: Windows 10, 64 bit

Re: lightmaps for random buildings

Postby Volador » Thu Apr 13, 2023 7:20 am

However, I've not seen it working in Next (the nightly build) my version must be about 3 weeks old. I've asked on the devs mailing list to see if anyone can help get this across the line.
User avatar
Volador
 
Posts: 1142
Joined: Tue Sep 01, 2020 4:58 pm
Callsign: Volador, G-VLDR
Version: 2020.4
OS: Windows 10, 64 bit

Re: lightmaps for random buildings

Postby Volador » Fri Apr 21, 2023 5:46 pm

Latest development but still need some help getting this to work properly.

I used Stuarts modifed .eff file but have changed line 40 in the lightmap texture definition values from 0.3 to 0.8 (this was how Gabo got the illumination to work.
<lightmap-color type="vec3d" n="0"> 0.8 0.8 0.8 </lightmap-color>

I've flattened the buildings.png (saved as bmp then again as png) as it did have some stray alpha stuff I just didn't see. Gabo and Stuart spotted this and it really helped.
I reduced the opacity of the reflective surfaces (defined as black rgb values) in buildings-reflectionmap.png to 50% as it seemed to be still fighting with the lightmap (not sure how Gabo got that to work)
I included a desaturated and darker buildings texture in buildings-lightmap.png background rather than having blank where there was no light.
I've still to redo the normal map but that's the last thing.
Here is the result, a little closer but lights are visible during the day and the reflections are not as prominent all which follows the changes above but surely there is a way to make lights off during the day and reflections more prominent (they are implemented in the .eff after all, why not make them nicer?) (I'll also pop a few skylights on rooftops later)
https://imgur.com/dupmVLv
https://imgur.com/Hc9yOvK

I could really use some help getting the textures to behave - I know there're some texture or effect gurus out there :) I've updated the files I'm using on Git here.

https://svn.code.sf.net/p/flightgear/as ... d/Finished texture atlases

On a side note, while driving over to see a friend yesterday evening I was watching the roof-tops in the sun in a valley below, very strong reflection while looking towards the sun - just like you would see on an approach, how tricky would it be to include the sun reflection (not the cube-map reflection) in buildings.eff or is it way too complex? (railway lines would be the other candidate for such reflections too I guess) In the advent of the new "HDR" stuff, this would add so much to the visuals.

Chris
User avatar
Volador
 
Posts: 1142
Joined: Tue Sep 01, 2020 4:58 pm
Callsign: Volador, G-VLDR
Version: 2020.4
OS: Windows 10, 64 bit

Re: lightmaps for random buildings

Postby erik » Sat Apr 22, 2023 11:40 am

Volador wrote in Fri Apr 21, 2023 5:46 pm:On a side note, while driving over to see a friend yesterday evening I was watching the roof-tops in the sun in a valley below, very strong reflection while looking towards the sun - just like you would see on an approach, how tricky would it be to include the sun reflection (not the cube-map reflection) in buildings.eff or is it way too complex? (railway lines would be the other candidate for such reflections too I guess) In the advent of the new "HDR" stuff, this would add so much to the visuals.

Without HDR it would be nearly impossible, unless you implement .. basically HDR.

Erik
Current: Parachutist, Paraglider, Pterosaur, Pilatus PC-9M and variants, ERCO Ercoupe, Fokker Dr.1, Fokker 50, Fokker 100
Less active: Cessna T-37, T-38, Santa Claus. Previous: General Dynamics F-16. Worked on: Wright Flyer
erik
 
Posts: 2248
Joined: Thu Nov 01, 2007 2:41 pm

PreviousNext

Return to Scenery

Who is online

Users browsing this forum: No registered users and 4 guests