Cubemaps, how do they work?
Also, if someone could clarify how those completed door instances are supposed to work, I'd be very appreciative. I can't for the life of me figure out how to cope with the Nodraw brush immediately behind the door.
Lots of textures, both on models and brush faces, have specular reflections. These reflections aren't rendered in real time (because that would be an unnecessary expense on processing power). Source uses prerendered static reflections of the world called cubemaps.
http://en.wikipedia.org/wiki/Cube_mapping
The above page explains the concept better than I, but essentially 6 shots are taken around a single point (the front, the back, the left, the right, above, and below). Those shots are then painted on the six inside faces of a hollow cube. If you can imagine standing inside the cube and looking around, you would see the same environment (source uses the same technique for its 2D skybox technology). We call this cube mapping, and the engine uses individually placed cubemaps for nearby reflections.
In terms of processing time, cubemaps are ridiculously cheap, and as long as they aren't too great in resolution or quantity, they're pretty cheap on memory as well.
When there are no cubemaps in a level, the engine will typically use the skybox for reflections. Here's a video I posted of another TWP member's map the other day:
http://www.youtube.com/watch?v=DY3425wr ... ideo_title
As you can see at the very end, the glass on the elevator is incredibly bright and jarring. This is because the engine is drawing the default reflection map because it cant find any cubemaps in the bsp. As you can see, a lack of cubemaps can make things look absolutely horrible at times.
&msleeper wrote:
As a general rule, you should add a cubemap where there is any major change in lighting. For example in the sewer/tunnel areas in the first part of this map, you should add a cubemap where the lights are, as well as add one where the dark areas are.Unfortunately it looks like Portal 2 doesn't have the cubemap testing "weapon", and I can't seem to get it to work by cheating and manually copying the model.
Ideally, cubemaps should be 64 units above the "ground", the ground being whatever surface the player is going to be walking around on. You can also tie a specific cubemap to a specific brush face - this is especially useful when placing glass or water.
You can easily overdo adding cubemaps into a map. The best way to see what a good layout for cubemaps is just to look in the Valve maps. Like I said, you want to definitely place them where there is a sharp contrast in lighting (such as in The Unknown), but if you have an area with similar lighting all around then you can generally get away with having fewer of them.
There's kind of an art to cubemapping, you'll get the hang of it once you look at some examples.