Valve's site is misleading in regards to cubemaps

Open Blade

L420: High Member
Nov 30, 2007
439
34
I'm stumped on this one. Go to their site and it tells you that you must run a certain set of commands. Then it goes on to tell you that if you are using HDR, you need to run another set of commands. But it doesn't tell you that you need to run both or either or depending on how you set it up. It's very misleading. I've enabled HDR in my map so I'm not sure which set of commands to run. Further more, it says that if you have renamed your map and did not rebuild all your cubemaps, the map will default to the skybox cubemap. So does that (rebuild) mean in Hammer you need to delete all the cubemap entities and add them all over again or does that mean in the game, running the set of commands which "builds" your cubemaps.

Thanks for the help.




This is what's on the Valve site:




Building

Once a map has been compiled and lit by VBSP and VRAD (respectively), the cubemaps can be built. Run the map and allow the any node graphs or other pre-process activities to finish. Then use the buildcubemaps console command to begin building the cubemaps for the level. In the upper left-hand corner of the screen you’ll be able to see each facet of the cubemap (six per cubemap) render. Depending on your video card, driver and complexity of your scenes, this can take seconds or minutes to complete. Once finished, the map must be restarted for the cubemaps to properly be applied to all surfaces.
Note.png Note: Team Fortress 2 does not have a default cubemap applied to reflective surfaces. Everything shiny will shine with a pink and black checkered texture. If you were to build cubemaps now and one of your cubemap is able to see a large shiny surface; the cubemap will register that in its 6 images. That means some objects might shine as if there was something shining next to it with the pink and black texture. To solve this, you need to build the cubemaps with specular turned off. Go to the console and execute the following commands to build the cubemaps for your TF2 map:

mat_specular 0
buildcubemaps
mat_specular 1
changelevel mapname
mat_reloadallmaterials

Note.png Note: If the game crashes when you try to build cubemaps, this probably means your game resolution is set too low. Before you try to build cubemaps you must ensure your game width and height are over 512 pixels. This means that the minimal standard resolution to build is 800X600. The video resolution can be changed from the Video tab, found under the game Options menu.
Note.png Note: If the map bsp file is renamed after the cubemaps have been built the cubemaps will no longer work and default to the sky cubemap. You must rebuild cubemaps again each time a map is renamed. However each time a map is renamed and the cubemaps rebuilt they will not replace the old cubemaps but rather a new set of cubemaps will be added to the bsp. Each time you rename a map and build cubemaps the bsp size will increase. It is best that your final compile of the vmf have the release name of the map so that only 1 copy of the cubemaps will reside in the bsp.
Note.png Note: For multiplayer maps, you may need to enable cheats (sv_cheats 1) before running the buildcubemaps command.


Cubemaps and HDR

If the map has been compiled with the HDR lighting option enabled in VRAD, cubemaps must be built in both HDR and LDR (non-HDR) modes. Building cubemaps in only one mode will mean that cubemaps will not be present the other mode. For information on how to build cubemaps under HDR, see HDR Lighting Basics.

Cubemaps should be built for LDR and HDR maps. Presuming you are already in HDR mode and have your map loaded fresh from compilation (VRAD must have the '-both' parameter enabled). Go to the console and execute the following commands:

buildcubemaps
mat_hdr_level 0 (to go to LDR)
map mapname (to reload map)
buildcubemaps
mat_hdr_level 2 (to go back to HDR)
map mapname (to reload map)
 

RavenStryker

Former Alias: †Blade†/Xi.Cynx
aa
Nov 25, 2008
782
844
I can't tell ya which one to use is what situation. But this is exactly how I build my cubemaps everytime and it works flawlessly.

Load your map into TF2
(Type the rest in console)
  • mat_specular 0
  • buildcubemaps
  • disconnect
  • mat_hdr_level 0
  • map <the name of your map>
  • buildcubemaps
  • disconnect
  • mat_specular 1
  • mat_hdr_level 2
  • map <the name of your map>
(end console)

If you compile the map again though you must rebuild the cubemaps using the in game console. Or if you change you map name you must do the same thing.
 

TheDarkerSideofYourShadow

L10: Glamorous Member
Apr 12, 2008
792
286
Blade, when you run those commands, how have you started the game? Have you manually launched it via the games tab of steam, or by having the compile process run the game. I usually get an area with the mat_hdr_level command :-/
 

RavenStryker

Former Alias: †Blade†/Xi.Cynx
aa
Nov 25, 2008
782
844
I load it up after it compiles. So whatever it uses to load it then.
 

Open Blade

L420: High Member
Nov 30, 2007
439
34
I can't tell ya which one to use is what situation. But this is exactly how I build my cubemaps everytime and it works flawlessly.

Load your map into TF2
(Type the rest in console)
  • mat_specular 0
  • buildcubemaps
  • disconnect
  • mat_hdr_level 0
  • map <the name of your map>
  • buildcubemaps
  • disconnect
  • mat_specular 1
  • mat_hdr_level 2
  • map <the name of your map>
(end console)

If you compile the map again though you must rebuild the cubemaps using the in game console. Or if you change you map name you must do the same thing.

Yup, that works. Thanks.

I always launch the game via steam. I always compile and choose do not start game option.
 

RavenStryker

Former Alias: †Blade†/Xi.Cynx
aa
Nov 25, 2008
782
844
11. map “cp_dustbowl”
We need to load another map, to clear the caches of your map contents, otherwise it will not reload any of the cubemaps.

I never had a problem with having to reload a different map. If I just load up the same one again after i build the cubemaps on it it looks fine. :\
 

Vigilante212

L420: High Member
Dec 21, 2008
481
33
"If the map has been compiled with the HDR lighting option enabled in VRAD, cubemaps must be built in both HDR and LDR (non-HDR) modes. "

Seems pretty self explanitory to me run both sets of commands for HDR
 

Pink_Panther

L3: Member
Dec 14, 2008
129
45
the key to the valve development site tutorials is that it assumes a base level of knowledge on the commands that are used.

If you dont know exactly what a command does, you will need to look up the command on the site as well. So far I have found every command in the site with a decient explination and every value option for them.

Anyone can follow a list and retype it. The key is understanding the commands to know what it is doing and if it is even necessary.

For your question, there are different ways to do it that all work.

buildcubemaps
switch to ldr
reload map
buildcubemaps
switch to hdr
reload map

is the basic model

depending on your computer, you may have to disconnect before reloading, you may have to load a different map to clear the material buffer, you may have to turn of specular.

Generally you shouldnt have to disconnect, it will auto disconnect with the map command. generally you dont have to turn off specular unless everything is purple/black checkboarded or all covered with white. You will want to load another map if its not showing your your reflextions. just have to know what each will do.

So, heres the key...read, read and read some more.