Valve's site is misleading in regards to cubemaps

Discussion in 'Mapping Questions & Discussion' started by Open Blade, Mar 27, 2009.

  1. Open Blade

    Open Blade L7: Fancy Member

    Messages:
    439
    Positive Ratings:
    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)
     
  2. a2h

    a2h L2: Junior Member

    Messages:
    93
    Positive Ratings:
    30
    VDC is a wiki.
     
  3. Open Blade

    Open Blade L7: Fancy Member

    Messages:
    439
    Positive Ratings:
    34
    none the less, I find it misleading or at worst involuntarily deceptive and if somebody here could clarify that would be swell.
     
  4. Xi.Cynx

    aa Xi.Cynx Former Alias: †Blade†

    Messages:
    775
    Positive Ratings:
    768
    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.
     
    • Thanks Thanks x 2
  5. TheDarkerSideofYourShadow

    TheDarkerSideofYourShadow L10: Glamorous Member

    Messages:
    792
    Positive Ratings:
    144
    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 :-/
     
  6. Xi.Cynx

    aa Xi.Cynx Former Alias: †Blade†

    Messages:
    775
    Positive Ratings:
    768
    I load it up after it compiles. So whatever it uses to load it then.
     
  7. Open Blade

    Open Blade L7: Fancy Member

    Messages:
    439
    Positive Ratings:
    34
    Yup, that works. Thanks.

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

    aa Xi.Cynx Former Alias: †Blade†

    Messages:
    775
    Positive Ratings:
    768
    No prob. man, anytime. That's what we are here for ;)
     
  9. Cameron:D

    Cameron:D L6: Sharp Member

    Messages:
    363
    Positive Ratings:
    145
    Someone needs to put my stuff on the VDC (See link in sig)
     
  10. Xi.Cynx

    aa Xi.Cynx Former Alias: †Blade†

    Messages:
    775
    Positive Ratings:
    768
    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. :\
     
  11. Vigilante212

    Vigilante212 L7: Fancy Member

    Messages:
    481
    Positive Ratings:
    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
     
  12. Pink_Panther

    Pink_Panther L3: Member

    Messages:
    129
    Positive Ratings:
    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.
     
    • Thanks Thanks x 1