Garry's Mod

Garry's Mod

Frozen Lake
 This topic has been pinned, so it's probably important
Heath Legend  [developer] 1 Dec, 2022 @ 2:59pm
Lighting Bugs
Unfortunately I cannot seem to get Cubemaps to work correctly while publishing this map, so you may get bright white props in game.

To fix this you can use the console command "mat_specular 0"
< >
Showing 1-6 of 6 comments
Hedron 1 Dec, 2022 @ 3:53pm 
Try baking them in-game. It'll take less than 5 minutes and you can safely re-upload the fixed .bsp file.

I was able to do it with the .bsp unpacked from your workshop upload.
The results look like this: https://imgur.com/a/i55NRZk

To build cubemaps in engine, steps are as follows:

In the main menu, open the developer console and enter:
sv_cheats 1 mat_specular 0 map gm_frozen_lake

Once the map is loaded, disable all non-native post-processing effects, like gbloom or sunbeams (as well as 3rd party HUDs, if you use any), then open the developer console again and use the following commands:
cl_drawhud 0 building_cubemaps 1 mat_envmapsize 1024 buildcubemaps

Once the last command has been entered, the game's controls will lock up and the engine will start recording and baking cubemaps.
Once complete, the map will reload automatically.
As soon as you've respawned, open the console again and enter:
disconnect mat_specular 1 cl_drawhud 1 sv_cheats 0 map gm_frozen_lake

(note, disconnecting to main menu before setting mat_specular is to avoid reload materials, simply to speed things up)

This will only have baked HDR cubemaps. If you don't care about LDR support, you can stop here.

The cubemaps are written directly into the .bsp file and do not require re-baking. The newly updated .bsp file can be redistributed and uploaded freely with other users seeing the exact same cubemaps.

For more details, see valve's official documentation on cubemaps:
https://developer.valvesoftware.com/wiki/Cubemaps

Hammer with Source SDK 2013 is known to have issues with cubemaps every now and then and I've seen a lot of mappers in the gmod scene who appear to have issues with building cubemaps.
Considering how easy the workaround/fix is without asking players to disable graphics features, I'd appreacite if anyone who reads this to spread the word.
Last edited by Hedron; 1 Dec, 2022 @ 4:00pm
Heath Legend  [developer] 1 Dec, 2022 @ 6:48pm 
Originally posted by Hedron:
Try baking them in-game. It'll take less than 5 minutes and you can safely re-upload the fixed .bsp file.

I was able to do it with the .bsp unpacked from your workshop upload.
The results look like this: https://imgur.com/a/i55NRZk

To build cubemaps in engine, steps are as follows:

In the main menu, open the developer console and enter:
sv_cheats 1 mat_specular 0 map gm_frozen_lake

Once the map is loaded, disable all non-native post-processing effects, like gbloom or sunbeams (as well as 3rd party HUDs, if you use any), then open the developer console again and use the following commands:
cl_drawhud 0 building_cubemaps 1 mat_envmapsize 1024 buildcubemaps

Once the last command has been entered, the game's controls will lock up and the engine will start recording and baking cubemaps.
Once complete, the map will reload automatically.
As soon as you've respawned, open the console again and enter:
disconnect mat_specular 1 cl_drawhud 1 sv_cheats 0 map gm_frozen_lake

(note, disconnecting to main menu before setting mat_specular is to avoid reload materials, simply to speed things up)

This will only have baked HDR cubemaps. If you don't care about LDR support, you can stop here.

The cubemaps are written directly into the .bsp file and do not require re-baking. The newly updated .bsp file can be redistributed and uploaded freely with other users seeing the exact same cubemaps.

For more details, see valve's official documentation on cubemaps:
https://developer.valvesoftware.com/wiki/Cubemaps

Hammer with Source SDK 2013 is known to have issues with cubemaps every now and then and I've seen a lot of mappers in the gmod scene who appear to have issues with building cubemaps.
Considering how easy the workaround/fix is without asking players to disable graphics features, I'd appreacite if anyone who reads this to spread the word.

Hi Hedron, I appreciate you taking the time to write this comment, however the issue is not with building the cubemaps but something else entirely which I am in the process of fixing. Thanks though
MARK2580 1 Dec, 2022 @ 7:54pm 
Originally posted by Hedron:
mat_specular 0
cl_drawhud 0
building_cubemaps 1
mat_envmapsize 1024

What the hell are you talking about ? Reflections with a resolution of 1024 ??? They will weigh just indecently much, secondly, I will look inadequate, everything will be as mirror-like as possible. Why disable HUD ??????. Just opens the map and enter "buildcubemaps", nothing else is needed. LDR has long needed to be cut out of the engine, it is obsolete and useless.
Hedron 1 Dec, 2022 @ 8:14pm 
Originally posted by Heath Legend:
Hi Hedron, I appreciate you taking the time to write this comment, however the issue is not with building the cubemaps but something else entirely which I am in the process of fixing. Thanks though
What exactly is the issue you're having, if you don't mind me asking?

Originally posted by MARK2580:
What the hell are you talking about ? Reflections with a resolution of 1024 ??? They will weigh just indecently much, secondly, I will look inadequate, everything will be as mirror-like as possible. Why disable HUD ??????. Just opens the map and enter "buildcubemaps", nothing else is needed. LDR has long needed to be cut out of the engine, it is obsolete and useless.
Alright, no reason to get all worked up.

Texture resolution can of course be lower, especially on maps with lots of env_cubemap entities you're of course right with your memory/performance concerns.
However, on this map (and with the average hardware going by the most recent steam survey in mind), it's negligible.

Further, cubemap texture resolution has zero impact on reflectivity. The cubemap UVs are uneffected, neither do any of the commands make things "more reflective", it literally just makes things more detailed in the most basic way, by increasing the cubemap resolution.
Comparison between different cubemap resolutions (512 vs. 1024): https://imgur.com/a/IZ8r74x

Disable hud to disable 3rd-party and Lua-based hud elements that can sometimes be drawn on-top of render targets, which then end up in the cubemaps. I do mention 3rd-party hud addons separately, so this is just making sure.
Example: https://imgur.com/a/lIPjgZM

I agree that LDR is no longer needed, hence why I didn't include it in my suggested steps, but I obviously didn't want to completely omit the possibilty either, you see?
I mentioned it simply for completion's sake.

Finally, while the command "building_cubemaps" is technically not needed to run "buildcubemaps", it does disable base-engine post-process effects and prevents otherwise broken lighting to be baked into the cubemap.
Last edited by Hedron; 1 Dec, 2022 @ 9:23pm
MARK2580 1 Dec, 2022 @ 8:24pm 
This is the first time I hear that hud elements fall on cubemaps, and I doubt that they can be seen if you generate an adequate resolution of no more than 128, and preferably 64, so that there is no perfect mirror.
Heath Legend  [developer] 2 Dec, 2022 @ 5:06pm 
This issue has now been fixed!
< >
Showing 1-6 of 6 comments
Per page: 1530 50