Product Chat / Experimenting with Lightmapping

Author
Message
Wolf
Forum Support
16
Years of Service
User Offline
Joined: 8th Nov 2007
Location: Luxemburg
Posted: 1st Jan 2020 22:18 Edited at: 1st Jan 2020 22:20
Happy New Year.

Every since the DX11 rewrite of GG, I have written off the lightmapper as entirely broken. There has been some talk about dynamic shadows being implemented at some point but that has not come to pass yet. What happened whenever I tried lightmapping my old maps was that all textures ended up flickering, entire models would show up pitch black, specular maps would read entirely wrong and some objects where scaled wrong or misshapen.

So I've pretty much deemed it a lost cause until GG user BOD mentioned somewhere that he has been lighting his scenes ever since and that even larger areas would work perfectly reasonable. Now his screenshots where a bit too dark with fire decals seeming unusually dim. I assumed that was some wrong setting on his part but later found out that the lightmapper seems to work a bit different than it used in the X9 version. The colors are different and more pronounced and you will find that it does indeed end up rendering the lightmaps rather dark.

So I ran a few tests, my first test was extremely simple. Just some architectural props by wizard of id and 2 of my own together with 2 lightsources. I left the default texture resolution of 1024 in the setup.ini, deactivated terrain rendering and off it went.

The result was just a flickering mess...however synchromesh (I think) once mentioned that I'd need to exit test game and enter again to see the results displayed properly...and that worked. There was indeed a lightmapped scene.

Rather energized by this find, I opened up another small map from the discontinued project "Skrye" and tried mapping it as well. And, to an extend, it worked as intended. Colors are different and the shaders do look different as well. For comparison I will add the old X9 lightmapped scenes as well.


X11 Version Render



2018 X9 Version Render



X11


X9


So to clarify: In order to get the lightmaps to work you need:

Quote: "bake your lightmaps (shift and f3), exit test game mode, reinitialize test game mode, (maybe swap back and forth from real time render to pre-bake), results.
"


Now rather intrigued by this I opened a complex map, with more involved architecture and some gameplay already present. Sadly, this map did not load as intended at all and ended up being more akin to what I used to see in earlier tests.






For comparison, here is the scene in the X9 lightmapper:




So, this is where I hope some of you come in!

This shows that the lightmapper does indeed, to some extend, work. However not always and I would like to determine how to operate it and if it can be used reliably at all. So if you have a few minutes to spare and a couple scenes that you wish to try baking, I'd really love to hear from you and see your results. I will certainly look into this further and update this thread if I find anything.
If you do share your content, please let us know your settings (what texture resolution? Did you use PBRoverride?)

In case you don't know what I am talking about, here is a tutorial.

Also note that this is about baked lighting only, not dynamic lighting Thanks!

Cheers!



-Wolf
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 1st Jan 2020 22:52
got to admit the ones that did work look a lot better though
have you looked into any of the shaders / textures for the models that didn't work? perhaps there's some common missing texture or a shader that is breaking the light mapping?
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
OldFlak
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 27th Jan 2015
Location: Tasmania Australia
Posted: 2nd Jan 2020 13:32
BOD those shots look great on my tablet, will check them out on my comp tomorrow.
Will try it myself again tomorrow was well - but last time I tried the process just bombs out...

Anyways - great screenies in this thread!!

OldFlak.....
aka Reliquia
i7-4790 @ 3.2GHz. 8GB Ram. NVidia GeForce GTX 1060 6GB. M1: Acer 31.5" @1920x1080 M2: Samsung 31.5" @ 1920 x 1080. M3: Acer 24" @ 1920 x 1080. OS: Windows 10 Pro 64-bit Insider.
PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 2nd Jan 2020 14:00 Edited at: 2nd Jan 2020 14:02
On many PC games you usually have a brightness setting like " Move slider so you can just about see the Logo " and this is because Devs realise every PC monitor varies in brightness so getting it right for everyone would be an almost impossible task .. You would probably have to go with your best guess
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 2nd Jan 2020 15:13
@ Wolf
Does LM work with multi-textures? I know it does not, but long time I have not try LM till today.
I prefer to make a debug video with all the steps.
Just the buildings has multi-textures.
PBRoverride = 1
All the LM settings values in setup.ini, as you stated above.
As you can see in the vid, I've close test game mode and turn again.

Maybe multi-texture meshes being the issue?

I remember you talking something about invisible items after LM, but not able to find out in your tuto.
BTW nice shots.


Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
RustyNuts
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 9th Nov 2011
Location: Warwickshire Great Britain
Posted: 2nd Jan 2020 16:20
It's not amazing but its getting there...needs tweaking but it's a start.
Lenovo G700 Laptop,i3-6gb ram,Nvidia GT720m

Attachments

Login to view attachments
PM
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 2nd Jan 2020 16:30
It's getting there, still looking a little too saturated and grainy for me, but it's better than it was, and i'm sure with some fine tuning of the sliders that can be mostly fixed.

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Primary Laptop:
i5, NV1050 4GB, 8GB memory, 1x 1TB HDD, Win10.

Secondary Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
Wolf
Forum Support
16
Years of Service
User Offline
Joined: 8th Nov 2007
Location: Luxemburg
Posted: 3rd Jan 2020 09:03 Edited at: 3rd Jan 2020 09:21
Quote: "have you looked into any of the shaders / textures for the models that didn't work? perhaps there's some common missing texture or a shader that is breaking the light mapping?"


Certainly! I made sure to remove anything that doesn't use entity_basic.fx so I can run a clean test. I later assumed that it might be because the level architecture was suspended high above the terrain (I wanted the level to constantly descend the player into a more and more cavernous environment) so the lightmapper didn't grab it but the solution was.

Once you are done baking the lightmaps, exit test game, save your map and then exit game guru. It will only show up once you reload your map.

@3com: I don't use multi textured props at all but its actually an interesting thing to try out for completion sake. It seems to have mostly worked for you but I still see a lot of inexplicably bright surfaces right below pitch black walls. So lightmapping and objects using multiple textures is something I will try out later.

@RustyNuts Cool! interesting level by the way!





So essentially I got it working. Here is how to use the lightmapper in the X11 Version:

* You will still have to block off your interior level from the sun light by using large walls or the dome prop you find in the "galaxy seed" folder.
* You will have to largely increase the surface level and perhaps the brightness level value with the sliders depending on what look you want to achieve. Use tinted fog to unity your scene, this can be crucial for the look. Play with all the sliders, this isn't WYSIWYG and you have to tweak everything after a build.
* Its crucial that once you baked the lightmaps you exit test game mode, SAVE, shut off GG completely, reboot it and then get back in game to see the lightmaps displayed properly. If you don't do this, all you see is black tar and some faulty rendered objects. This is why I assumed it was broken originally. Just going back to editor and then test game again won't cut it in most cases.
* You will want to use PBROVERRIDE = 1. Some of your props will need editing to look right but if you stick to the old render pipeline, you will have specular maps boosted to a ridicoulus level, objects randomly glowing and missing shadows.


This is what you see after a bake if you don't reboot GG.



However, it will work later on.






Naturally, these are older maps and not fully tweaked for the new thing but I am looking forward to use it more in the future.
You can actually have amazing soft, defined shadows with this, its not a bad lightmapper at all, it was just a bit illusive to get it to work as intended.



-Wolf
RustyNuts
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 9th Nov 2011
Location: Warwickshire Great Britain
Posted: 3rd Jan 2020 10:19
Great info there Wolf as always!! Just a quick question did you use the default lightmapping setting in the setup.ini file?? And thanks for the like on my pic, it is deffo a work in progress .
Lenovo G700 Laptop,i3-6gb ram,Nvidia GT720m
PM
Wolf
Forum Support
16
Years of Service
User Offline
Joined: 8th Nov 2007
Location: Luxemburg
Posted: 3rd Jan 2020 11:31
Hey RustyNuts, yes I did! (only tweaked value was setting lightmappingexcludeterrain to 1)
RustyNuts
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 9th Nov 2011
Location: Warwickshire Great Britain
Posted: 3rd Jan 2020 12:01
Yes that's the only one I have changed. Think I might have a play with the others, see what happens to my level??
Lenovo G700 Laptop,i3-6gb ram,Nvidia GT720m
PM
Wolf
Forum Support
16
Years of Service
User Offline
Joined: 8th Nov 2007
Location: Luxemburg
Posted: 3rd Jan 2020 12:34
Sure! Please share your finds here
Avenging Eagle
18
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: UK
Posted: 6th Jan 2020 20:39
I knew about exiting test game after lightmapping already, but I'm still not satisfied and am really struggling to strike the right balance.

Here's my scene; every asset apart from the chandelier and candlestick holder is PBR. PBRoverride is set to 1. lightmappingdeactivatedirectionallight = 0 . The entire level is enclosed by a large hemispherical structure found in the Galaxy Seed folder, this is just to block out the sun.

My first lightmapping attempt yielded this:

Surface Level: 50
Ambience: 0 (only walls seem effected by it though)
Sun Surface Factor: 100

Next, I tried dropping Sun Surface Factor. This removed the discrepancy between walls and floor, boosted the intensity of the lightmaps, but also raised the ambience. In my level, it's crucial I have large portions of pitch black.

Surface Level: 50
Ambience: 0
Sun Surface Factor: 0

In order to get the pitch black areas of my level back, I had to drop the Surface Level way down to 16. This makes the lightmaps appear too dim.

Surface Level: 16
Ambience: 0
Sun Surface Factor: 0

Next, I tried deactivating directional lightmapping in the setup ini (lightmappingdeactivatedirectionallight = 1), and lightmapped again. After playing with the Surface Level, I got something OK, but dynamic lights had no effect on the level. I also had to bring Sun Surface Factor back up to 100. Here's the level running the pre-baked lightmaps.

lightmappingdeactivatedirectionallight = 1
Surface Level: 65
Ambience: 0
Sun Surface Factor: 100
Pre-Bake

And here is that same scene in realtime. At least the dynamic light attached to the flaming torch now works, but at the expense of all ambience

lightmappingdeactivatedirectionallight = 1
Surface Level: 65
Ambience: 0
Sun Surface Factor: 100
Realtime


Results: inconclusive...

AE
Wolf
Forum Support
16
Years of Service
User Offline
Joined: 8th Nov 2007
Location: Luxemburg
Posted: 6th Jan 2020 20:55 Edited at: 6th Jan 2020 20:56
Interesting! Thanks for the detailed test, mixing dynamic with static lights is something I wanted to tackle next.

(offtopic but allow me to mention again how brilliant that torch looks!)

Quote: "I knew about exiting test game after lightmapping already"


that only works occasionally. I found out that you actually have to leave all of game guru after a bake and reload the map for it to render properly. Something something RAM I'd assume.
Avenging Eagle
18
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: UK
Posted: 8th Jan 2020 21:41
Quote: "mixing dynamic with static lights is something I wanted to tackle next."


It's a pretty integral part of this game since a dynamic light has to follow the torch around at all times. And thank you! Huge thanks to AmenMoses for slaving away to make the scripting for the torch work, and making the necessary engine changes for it to work.

AE
Wolf
Forum Support
16
Years of Service
User Offline
Joined: 8th Nov 2007
Location: Luxemburg
Posted: 14th Feb 2020 14:45
I've been working with the lightmapper again and it does hold up quite well, even lighting trees and exteriors properly now.
There are however still some issues as some of the medieval stock props by arteria 3d will end up disfigured (misplaced vertices).
However, given that GGMax will have a new rendering engine, I believe its not making a lot of sense to dive too deep into this feature now. It is still quite useful though for GGC users.





Cheers!



-Wolf

Login to post a reply

Server time is: 2024-04-26 19:58:55
Your offset time is: 2024-04-26 19:58:55