How to compile cubemaps properly (for real this time!)

Discussion in 'Tutorials & Resources' started by azureguy, Nov 1, 2012.

  1. azureguy

    azureguy L1: Registered

    Messages:
    3
    Positive Ratings:
    0
    How to build cubemaps properly (for real this time!)

    Edit: As of July 2013, cubemaps seem to be compiled after typing "buildcubemaps". You're disconnected from the server and rejoin automatically, meaning that all the steps you had to do manually before are not unnecessary.
    I'll leave this post as it is for reference, but it seems cubemaps can now be compiled as easily as it should've been in the first place. Valve did good this time around!

    Cubemaps - you either get them to work or not. Especially beginners think that it's the biggest obstacle in Hammer that just cannot be overcome (until they learn about leaks, areaportals, optimizations and all the other wonders of Hammer...).
    There are a few tutorials and guidelines on the Internet how to do build them, and while it works for some, it also sometimes doesn't work for others. After figuring out a method that works to 100% for myself, I wanted to share it so that newcomers can save lots of time and sanity instead of countless trial & error.
    Edit: Yes I know that there are other guides for this as well. However, this guide is a bit more transparent as it mentions a few things others don't mention such as the filesize for confirmation and what exactly the deal with hdr is.
    Just don't kill me for my failure to see past page 5 in the search bar, ok?

    _______________________

    First off, make sure that your map has no leaks. If you still need to test compile your map in order to find the remaining leaks, remember that setting both VIS and RAD to "No" in the “Run Map” window (the compiling process, opened with the shortcut F9) saves compiling time. If there are no leaks left, move on.

    There are two cubemaps required actually - one with high dynamic range turned on and one with high dynamic range turned off. Since Team Fortress 2 supports DirectX 8, but DirectX 8 doesn't support certain lighting effects, cubemaps must be build for both cases so that they're compatible with both old and new hardware. Maybe your map is never played by a gamer with an old computer, but in case it is and you receive a complaint, don't say I haven't warned you.

    You can set the high dynamic range via the console (mat_hdr_level 0 and mat_hdr_level 0 respectively), but in case that doesn't work, just set it on or off via the in-game options menu. The following instructions use the in-game options menu.

    _______________________

    Now for the steps:

    0. (self-control step) go to your maps folder and check the filesize of your map. Should the mapsize not increase after all the steps are done, then something went wrong. If it does increase, it worked.

    1. Set High Dynamic Range via the In-Game options menu to “None”.

    2. Load your map via the “Create Server” option (The + symbol on the “Server” tab).

    3. Once the map is loaded, open the console.

    4. Type in the following commands. Don't be surprised if the game doesn't respond for a few seconds, that's perfectly normal.

    sv_cheats 1
    mat_specular 0
    buildcubemaps
    mat_specular 1
    disconnect

    5. After the “disconnect” command you'll be brought back into the main menu, but the console is still open. Type in the following commands.

    sv_cheats 1
    mat_reloadallmaterials

    (yes, I list "sv_cheats 1" twice here, but better safe than sorry right?)

    6. Close the console, the set High Dynamic Lighting via the In-Game options menu on “Full (if available)”. After that, close the game and restart it.

    _______________________

    Your map now has cubemaps for High Dynamic Range turned off. The filesize should've increased by a little bit. It's not much of an increase even for huge maps, but check whether the filesize has changed as opposed to before regardless.
    After you've started the game once again, repeat the steps 2 through 5 and check the filesize once again. If it has increased once again, everything worked out fine.



    Aaaaand that's all folks. Let me know if that worked out for you.
     
    Last edited: Jul 15, 2013
  2. tyler

    aa tyler snail prince, master of a ruined tower

    Messages:
    5,031
    Positive Ratings:
    3,975
    Thanks, but we've got plenty of threads on this, including this one which works perfectly because I do it this way every time.
     
  3. azureguy

    azureguy L1: Registered

    Messages:
    3
    Positive Ratings:
    0
    Why isn't this stickied, then? When I typed "cubemaps" in the search engine, it only shows up on page 7 (I only checked the first 5 pages I admit).
    Ah well, at least one viable method is visible for those that only check the first page. Thank you for not killing/banning me for this human mistake.

    Edit: I just checked all of the stickies in the subforum, including those that I ignored before because I thought they were just map packs or something. Lo and behold, there is a link to a cubemap guide after all... Why am I ALWAYS failing to see this when it's too late?
    However, the cubemap guide link in the other post is deleted, so it returens a 404. Might want to repalce it with another guide.