Env_cubemaps

Avatar
spare8ball
10 Posts
Posted Apr 22, 2008
i was looking for an average number of about how many cubemaps should be used on a portal map.
Advertisement
Registered users don't see ads! Register now!
Avatar
Fusion
77 Posts
Posted Apr 22, 2008
Replied 4 hours later
It depends on the size of the map of course. For an idea you could vmex some of the professional testchambers and see how many cubemaps they put in and where.

Remember that a shiny surface shows its nearest cubemap as its reflection so, for example, if you had a cubemap above where the floor was water you wouldnt want nearby walls to lock onto that cubemap if there is was a concrete floor below those nearby walls; so you would need two cubemaps, one reflecting the water and one reflecting the concrete.

Hope this helps.

Avatar
Ricotez
738 Posts
Posted Apr 22, 2008
Replied 4 hours later
Cubemaps can significately add up to the size of a map file. But the wrong cubemaps on a surface look very ugly. You should bother more about the places you put cubemaps than about the number. As long as you place them smart, you don't need too many. It's just like optimisation.

For example: a square room almost completely composed out of metal with a few concrete surfaces can easily do with 1 cubemap placed in the middle. The same for an almost completely concrete chamber with a few metal surfaces. It requires a lot of trial and error to get right.

Having said that, you of course still don't have a real answer to your question. The number of cubemaps really depends on your map. Like I said, through simple trial and error you'll get there.

Avatar
msleeper
4,095 Posts
Admin
Posted Apr 22, 2008
Replied 4 hours later
Cubemapping is an art, not a science. There is no "right" way to do it, but there sure are plenty of "wrong" ways.
Avatar
Hober
1,180 Posts
Posted Apr 22, 2008
Replied 8 minutes later
As the resident Rube, I think it's worth pointing out that the above points about "winging it" and learning the proper way through trial and error are correct. But the question was simple and is, as yet, unanswered: what's a ballpark figure for a good number of them?
Avatar
taco
504 Posts
Posted Apr 22, 2008
Replied 15 minutes later
There is no ballpark figure out there, the ballpark is based on each map individually.

The easiest way to get an estimate is to add up the number of areas of visual contrast in you map (contrast in lighting, texture etc.).
Example: If you have a completely metal room between 2 elevators, you would want to use 3 cubemaps: 1 cubemap in the middle of the room and 1 cubemap in front of each elevator.You'll still need to test the cubemaps to make sure everything looks good, but this should give you a good place to start.

Avatar
MrTwoVideoCards
584 Posts
Posted Apr 22, 2008
Replied 49 minutes later

msleeper wrote:
Cubemapping is an art, not a science. There is no "right" way to do it, but there sure are plenty of "wrong" ways.

Like mentioned above it depends on the brush work and surrounding of your map, not the size, Cube mapping is an art. Each cubemap should be placed 35 units above a surface that is reflective. Also you wont need more than one cubemap for a single room, unless the room it self is very large. A cubemap should be placed in a 512 unit radius. That means every 512 units a cubemap should be present as long as the room is large. That however does not mean you should have large ass reflective brushes. You also have to take care of the fill-rate rendering for those surfaces. Also what they reflect. So, cubemap values and keys arent needed to be used unless your doing some really special reflection work, but even then, you'll hardly use them either.Same thing for glass, if theres a glass wall, a cubemap should be on each side, 15 units away from the glass.

Floor - 35
Glass - 15
Water - 40
wall - 35
Sky - 40 (only for HL2 of course)

I hope that helps.

Avatar
Aldéz
221 Posts
Posted Apr 22, 2008
Replied 3 hours later

MrTwoVideoCards wrote:

Like mentioned above it depends on the brush work and surrounding of your map, not the size, Cube mapping is an art. Each cubemap should be placed 35 units above a surface that is reflective. Also you wont need more than one cubemap for a single room, unless the room it self is very large. A cubemap should be placed in a 512 unit radius. That means every 512 units a cubemap should be present as long as the room is large. That however does not mean you should have large ass reflective brushes. You also have to take care of the fill-rate rendering for those surfaces. Also what they reflect. So, cubemap values and keys arent needed to be used unless your doing some really special reflection work, but even then, you'll hardly use them either.Same thing for glass, if theres a glass wall, a cubemap should be on each side, 15 units away from the glass.

Floor - 35
Glass - 15
Water - 40
wall - 35
Sky - 40 (only for HL2 of course)

I hope that helps.

I wouldn't go as far as calling it an art. I agree that the amount of cubemaps don't nesseceraly depend on the size of the map, but the distances you talked about don't make sense. Where did you get those values from? Why 15 units when you can have 16 units (so you easily can align them to the 16 units wide grid)? Why put a cubemap by the sky? And 64 units above the floor is better than 35. 64 units is about the same hight as the hands of the player. I wouldn't make a recommendation for distances between cubemaps and surfaces at all except for one. A cubemap shouldn't be closer than 16 units from a surface.

IMO, the fewer cubemaps, the better. The file size will be smaller and you don't get flickering reflections as you walk through them. The framerate could be affected too in some cases. I usually put one cubemap per room. The default resolution for the cubemaps is too low in most cases for you to see the difference between having one or ten cubemaps in a room. There are exceptions of course, for example rooms with complex design.

If the room is large I put cubemaps by the entrances so no other cubemap will be too close to the farther ends of the room. Assigning brush faces can be a good idea for large reflective surfaces that are devided in many brushes. Then you don't get different cubemaps on the same wall or ceiling etc.

This is a good page to read for more info:

http://developer.valvesoftware.com/wiki/Cubemaps

Avatar
spare8ball
10 Posts
Posted Apr 22, 2008
Replied 17 minutes later
thanks a lot for your responses so fast! ive read plenty of cubemap tuts, but a lot of the recommend different ideas, so id thought i would ask you peoples for some help. ill probably stick with one cubemap per room i guess, and ill add more where ever i need them such as glass
Advertisement
Registered users don't see ads! Register now!
Avatar
MrTwoVideoCards
584 Posts
Posted Apr 23, 2008
Replied 9 hours later

Ald?z wrote:
I wouldn't go as far as calling it an art. I agree that the amount of cubemaps don't nesseceraly depend on the size of the map, but the distances you talked about don't make sense. Where did you get those values from? Why 15 units when you can have 16 units (so you easily can align them to the 16 units wide grid)? Why put a cubemap by the sky? And 64 units above the floor is better than 35. 64 units is about the same hight as the hands of the player. I wouldn't make a recommendation for distances between cubemaps and surfaces at all except for one. A cubemap shouldn't be closer than 16 units from a surface.

IMO, the fewer cubemaps, the better. The file size will be smaller and you don't get flickering reflections as you walk through them. The framerate could be affected too in some cases. I usually put one cubemap per room. The default resolution for the cubemaps is too low in most cases for you to see the difference between having one or ten cubemaps in a room. There are exceptions of course, for example rooms with complex design.

If the room is large I put cubemaps by the entrances so no other cubemap will be too close to the farther ends of the room. Assigning brush faces can be a good idea for large reflective surfaces that are devided in many brushes. Then you don't get different cubemaps on the same wall or ceiling etc.

This is a good page to read for more info:
http://developer.valvesoftware.com/wiki/Cubemaps

Heh, well then you answer his question Mighty Cubemap Lord. But, when you get down to it, the reason I listed these values, are all apparent when you get to the Lump file In the BSP, and the BuildCubeMap's Process. MAINLY! With HDR!