Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: DaBrain on July 25, 2010, 09:57:00 am

Title: Saving cube maps
Post by: DaBrain on July 25, 2010, 09:57:00 am
The developers of the Shadows of Lylat team decided to drop the old ambient light system and go for diffusely convolved cube maps.

While the changes in the shaders are no problem, there is a bit of extra work needed for the cube maps.


Of course I'd like have the final cubmaps as close to the original background as possible.
I'm not 100% sure, but I think there was a way to export the currenly used cubemap from FSO, or grab it somewhere.


Could somebody point me in the right direction? ;)

Title: Re: Saving cube maps
Post by: Aardwolf on July 25, 2010, 12:12:13 pm
If I'm reading this correctly...

You want programmatic access to the automatically generated cubemap? Or do you just want to export?

Also, diffusely convolved cubemaps FTW!
Title: Re: Saving cube maps
Post by: DaBrain on July 25, 2010, 12:23:37 pm
I just want to export it.  I'll do the blurring myself.




It looks pretty awesome. :)
Title: Re: Saving cube maps
Post by: Woolie Wool on July 25, 2010, 05:54:48 pm
Step 1: Enable the "save render targets to file" command line/launcher flag.
Step 2: Start FSO.
Step 3: Load a mission.
Step 4: Alt-Tab away from game.
Step 5: Go to /yourmod/data/cache and copy "cubemap.dds" to wherever you want.
Step 6: ???
Step 7: Profit!
Title: Re: Saving cube maps
Post by: DaBrain on July 26, 2010, 12:51:05 am
That sounds promising!


Thanks, I'll try that. :)
Title: Re: Saving cube maps
Post by: Fury on July 26, 2010, 01:06:13 am
The developers of the Shadows of Lylat team decided to drop the old ambient light system and go for diffusely convolved cube maps.
I'm curious as to what exactly does this mean? What kind of changes are needed in shaders and how exactly the two differ in-game?
Title: Re: Saving cube maps
Post by: Pottuvoi on July 26, 2010, 06:50:37 am
This thread should answer your question.. ;)
http://www.hard-light.net/forums/index.php?topic=65535.msg1306320#msg1306320
Title: Re: Saving cube maps
Post by: DaBrain on July 26, 2010, 04:28:35 pm
Yep, that pretty much covers it.

You don't need a special shader. In fact it would be better to edit all specular maps. We're just taking the easy way.

As far as the visual difference goes:


This is the old ambient light system:
(http://i30.tinypic.com/280rux2.jpg)


This is a shot without ambient lighting (and no emissive light either), but with a diffusely convolved cube map:
(http://i29.tinypic.com/ofd3ky.jpg)


I'd recomend waiting for the material system before you use it though.
You loose all sharp reflections and you'll probably have to edit most if not all specular maps.

On the plus side, it doesn't cost any performance and it doesn't kill the normal maps anymore, like the ambient light does.
Title: Re: Saving cube maps
Post by: Commander Zane on July 26, 2010, 10:18:30 pm
Sexy ship.
Title: Re: Saving cube maps
Post by: Aardwolf on July 26, 2010, 10:38:34 pm
Does the ambient lighting change according to the normal map, or only according to the per-vertex normals (model smoothing)?
Title: Re: Saving cube maps
Post by: DaBrain on July 27, 2010, 12:51:05 am
The "lighting" changes according to the normal map with per-pixel precision.
Title: Re: Saving cube maps
Post by: Aardwolf on July 27, 2010, 07:15:33 am
Win.
Title: Re: Saving cube maps
Post by: Angelus on July 27, 2010, 07:39:40 am
Win.

Epic Win, actually.