Does a map needs cubemaps?

Discussion in 'Mapping Questions & Discussion' started by Simulacron, Apr 18, 2016.

  1. Simulacron

    Simulacron L6: Sharp Member

    Messages:
    299
    Positive Ratings:
    151
    My problem is that I don't really understand which purpose the env_cubemap entity has. I never used it and didn' t have any problems with reflections or whatever the entity does.
     
  2. Moonrat

    aa Moonrat The end of an era

    Messages:
    896
    Positive Ratings:
    529
    Cubemaps make your level have reflections on things that reflect. Generally, they're recommended to have, but not required in an Alpha map. Though one thing to note is that other players on your map DO NOT have a default cubemap, meaning that they will see a missing texture on any reflective surfaces. Keep this in mind if you start having a lot of reflecting things in your map.

    As for a finished map, you'd be an idiot to not put them in, for obvious reasons.
     
  3. Lampenpam

    aa Lampenpam

    Messages:
    1,019
    Positive Ratings:
    337
    Unless you place a cubemap in your map but never render it. In this case the map will look like you have mat_specular 0
    I did that in my detail contest map since the reflection of the water looked crappy and also with other maps, the players never noticed it so I don't think they are that important. They use up rather much of the file space for a rather cheap looking effect, espicially on weapon models where it just suddenly pops to the next cubemap when moving around.

    But since cubemaps are kinda expected to have you should use them, I recommend upping their resolutions in some places to make reflections look better though that also uses up more filesize so don't overdo it.
     
    • Useful Useful x 1
  4. Aeix

    Aeix L3: Member

    Messages:
    148
    Positive Ratings:
    42
    In short: Yes
    In long: They create reflections on reflective surfaces, if you don't have them, then you see missing textures instead of a reflection. You don't really need them in Alpha maps, but in beta maps they are needed (also, they take about 2 seconds to put down and configure).
    Also yes, I have a surface of water in one of my maps, and although I have never had any problems with it, other people seem to have had problems with it (a few !fb give water a cubemap)
     
  5. Muddy

    Server Staff Muddy Muddy

    Messages:
    2,381
    Positive Ratings:
    4,210
    Protip, you only need one env_cubemap in your map to stave off the missing reflections issue, so you can save yourself some time and everyone else some hassle if you build just one set of cubemaps.

    Also, I can't remember whose it was, but I remember playing on a map once where someone had stuck the map's one sole env_cubemap inside a room textured entirely with the Jimi Jam logo, so everyone in the server had Jimi Jam cubemaps. Fun times.
     
    • Funny Funny x 4
  6. worMatty

    aa worMatty Repacking Evangelist

    Messages:
    1,072
    Positive Ratings:
    834
    Cubemaps are special VTF files embedded in the map. Each contains six images, each a photograph of a direction in the 3D world (up, down, north, east, south and west). These images are reflected back from reflective brush and model surfaces to give the illusion of real-time, dynamic reflections. The env_cubemap entity tells the game the position where it should capture these images from, when you execute the buildcubemaps command. Reflective surfaces use the closest env_cubemap entity for their reflection images. When detailing a map in beta, you would give each separate area, room or connecting corridor its own cubemap(s) so that the surfaces reflect the right surroundings. Player weapon and cosmetic models will change cubemaps as they move through the map. You can see this effect in the sniper's rifle scope.

    More info on the env_cubemap entity and how a cubemap VTF is structured can be found here and here.

    You may have trouble when packing custom assets in to your map, if you did not place any env_cubemap entities. For an alpha map, as Muddy says, it cuts down potential problems if you include at least one. Commonly, mappers place this 'dev' env_cubemap alongside the rest of the map's main logic entities, which can usually be located in the centre of a symmetrical map, or at the beginning of a linear map. Maps compiled with HDR lighting require more work to build cubemaps, which is one of the reasons why we recommend that alpha maps only be compiled in 'LDR'.
     
    • Thanks Thanks x 1
  7. UKCS-Alias

    aa UKCS-Alias Mann vs Machine... or... Mapper vs Meta?

    Messages:
    1,264
    Positive Ratings:
    748
    Note that based on the skybox it can give you the default one. That cubemap is simply the skybox. When not placing cubemaps it normaly will use this one, with custom sykbox textures it usualy does not. So if you use a default skybox not placing a cubemap is better than placing 1 at a random spot as the default skybox cubemap is often equaly good looking as a cubemap for a wrong section of the map.
    If you place 1 cubemap and it doesnt have a skybox that works the compile will state an error instead of:
    Code:
    Creating default LDR cubemaps for env_cubemap using skybox materials:
      skybox/sky_sandstorm_01*.vmt
     ! Run buildcubemaps in the engine to get the correct cube maps.
    Creating default HDR cubemaps for env_cubemap using skybox materials:
      skybox/sky_sandstorm_01*.vmt
     ! Run buildcubemaps in the engine to get the correct cube maps.
    
    The error might look like:
    Code:
    *** Error: Skybox vtf files for skybox/sky_tf2_04 weren't compiled with the same size texture and/or same flags!
    Can't load skybox file skybox/sky_tf2_04 to build the default cubemap!
    *** Error: Skybox vtf files for skybox/sky_tf2_04 weren't compiled with the same size texture and/or same flags!
    Can't load skybox file skybox/sky_tf2_04 to build the default cubemap!
    
    If you put in 1 cubemap and dont build the cubemaps this would give an error. Without a cubemap it falls back to the skybox.

    Obviously, players will still notice it as the sniper rifle lens gives a quite clear view of cubemaps. But a default cubemap is not a problem at all. Only purple checkers are, and even in alpha maps i would at least solve those.
     
  8. henke37

    aa henke37

    Messages:
    1,878
    Positive Ratings:
    442
    Note that most skyboxes in TF2 are incompatible with being the default cubemap. This since they aren't using the same resolution for all faces, in particular the bottom tends to be 1x1 texels.