Problem Building Cubemaps

D

Demaratus

Guest
I compiled a test version of lockdown, pasted the .bsp into my deathmatch maps folder, ran the game and the map, and ran buildcubemaps.

After doing the sampling for each cubemap, I got the following error:

...
bounce: 1/1 sample: 146/147
bounce: 1/1 sample: 147/147
vtex failed to compile cubemap!
Unable to remove c:\program files\valve\steam\steamapps\demaratus\half-life 2 deathmatch\hl2mp\materials\maps\dm_lockdown_test\c-2631_3527_173.vtf!
Creating default cubemaps for env_cubemap using skybox sky_day02_09...
Material "debug/debuglightmap":
No render states in shader "LightmappedGeneric_DX8"
Material "debug/debuglightmapzbuffer":
No render states in shader "LightmappedGeneric_DX8"

Does anyone know why I'm getting this error and how I can solve it? I really would like to have the ability to do reflective surfaces.

Why is vtex unnable to build cubemaps?
 
I would try checking the file it says it's unable to move. Maybe it's set to read only?
 
The file it's refering to isn't in that folder now when I just checked. There isn't anything strange I have to do to buildcubemaps, I just copy the bsp into the maps folder, run the map, and build?
 
Demaratus said:
The file it's refering to isn't in that folder now when I just checked. There isn't anything strange I have to do to buildcubemaps, I just copy the bsp into the maps folder, run the map, and build?
yup, just buildcubemaps is all thats needed so long as the env_cubemaps are placed.

it mentions DX8.. maybe DX8 can't reflect fully to make use of cubemaps?
 
Yeah, I thought about that, so I used the mat command that forces hardware DX9 (although even on my Ti4600 I always have software emulation of DX9), since my framerate while I'm calculating cubemaps isn't important, but it still didn't work.

I hope that one doesn't have to have a dx9 card to build cubemaps. I can see reflected surfaces from cubemaps in game, like the ones in the official version of lockdown (which I'm just trying to compile myself as a test), so I don't understand why that would be the case.

Right now I'm setting up my testmap (the infamous box room with lots of screwy stuff in it while I learn;) and going to try to build some cubemaps in that. If that doesn't work, I'm really going to raise som hell to get some answers, heh.
 
to make cubemaps... do i just add env_cubemap and that is it?

cause i did that, went into the game and it didn't seem to show any reflection light on the walls/floors?
 
You have to load the level and type the command 'buildcubemaps' (without quotes) into the console. This builds them and applies the results to the .bsp.

My problem is it's not building them properly. Let me know if you have a similar problem with the buildcubemaps command.
 
Ok this is what a env_cubemap is

Source can do realtime reflection eg: water. But to have that on so many surfaces, its gonna kill the framerates. Same has always applied with pre-rendering. Real reflections take longer. So once upon a time someone invented this idea where you could use an image as a fake reflection. The benefits of this is there's next to no hit in rendertimes, both pre-rendered and realtime. But at the same time, the reflection isn't actually a reflection atall, but it looks like one so who really minds.

an env_cubemap is basically six camera's all pointing in a different direction. Each camera (view) has a square pixel aspect and see's everything around them, from the point of an env_cubemap you can see in any direction.

So you've got your materials with reflection in your map.. Now these reflections aren't real, so without env_cubemaps, it defaults to a background reflection map, which is why you will see NPC's and materials acting shiny in pure darkness. To fix that, you use the env_cubemaps around the center of each contrasting area. Eg: one in a room, one in a corridor, one in another room. That way, when you run buildcubemaps, each one takes a photo of what it can see from each of the six directions and creates a virtual cube around that area, which the materials can then see as reflections

The reason for having more than one env_cubemap is unless your map is just one big empty area with no real changes, you need to get the correct images for each area, so reflections look correct in the right places.

env_cubemaps also let you select brush surfaces to be effected. In more complex maps you might want to do this to ensure the right surface gets the right reflection from the right env_cubemap.

Another reason for them, is of course the models use these maps too, so you want them to be reflecting what appears to be the current surroundings, and not something from the other side of the map they couldn't possibly reflect. This goes for weapons too. Basically anything that has a reflection needs to take it from the nearest cubemap, otherwise it'll not look correct.

Lastly, if you look in the scope of the crossbow.. thats not a real reflection, its the cubemap in that area.

Cubemaps are also dependant on your hardware. If you try generate too large cubemaps, you'll need to up your resolution in the game (as it basically takes a screenshot from each view of each env_cubemap) So the quality in the game has a lot to do with it, up all the effects to max to make sure things will look ok.

Water surfaces work a little bit differently, because those are part realtime reflections (thats why you can see NPC's and props etc. much clearer than a cubemap will give) The cheaper water reflections are taken from cubemaps, the full on ones are done in realtime. AFAIK heh
 
Dark Elf is the man. Instead of flaming us, he teaches us. =)

Now, I'm about to test my test map with cubemaps. They'd better work.

Just got to crank all of my settings to max so the cubemaps look perty=)
 
Demaratus said:
Dark Elf is the man. Instead of flaming us, he teaches us. =)

Now, I'm about to test my test map with cubemaps. They'd better work.

Just got to crank all of my settings to max so the cubemaps look perty=)
remember you can change the individual cubemap resolutions, for darker less detailed area's use a smaller resolution, for fancy area's use something higher. Will keep speeds up and keep the filesize down.

Also you can use the env_cubemaps incorrectly to get strange effects. eg: say your making a horror mod. You've got your map looking normal but scary.. flip a switch to turn on glowing drawings and pentagrams all over, run the buildcubemaps, then turn them off again. And all your reflections will have an eerie look to them (also works with faked reflections of things that aren't there, like great aunt mary heh.

and I'm having tons of fun in the mapping section.. Had barely posted here before the SDK came out :D
 
very nice description Dark Elf.. i'm a bit cozier with them now=)

so did you mean to up the settings just for that first buildcubemaps command so that your 'master' .bsp file was of bestest quality?
 
polypod said:
very nice description Dark Elf.. i'm a bit cozier with them now=)

so did you mean to up the settings just for that first buildcubemaps command so that your 'master' .bsp file was of bestest quality?
No, everytime you recompile the map you'll need to run buildcubemaps (though maybe not if you only ran entities only.. im unsure though about that bit)

You'd simply up the quality of the engine for when you run buildcubemaps (it does it very quickly so even if it crawls with everything on high it'll be fine for just this) and if you set different resolutions for each env_cubemap in your map, depending on its location, you can keep the quality high where you need it and low where it wont be noticed so much, otherwise your saving possibly a great many large res cubemaps, which is gonna slow things down aswell as make a larger file (longer load times). So you simply decide where you want better quality or not. Though in most cases leaving those at default resolution should be ok, but its something to play around with to squeeze evey extra frame per second out of it.
 
The Dark Elf said:
remember you can change the individual cubemap resolutions, for darker less detailed area's use a smaller resolution, for fancy area's use something higher. Will keep speeds up and keep the filesize down.

Also you can use the env_cubemaps incorrectly to get strange effects. eg: say your making a horror mod. You've got your map looking normal but scary.. flip a switch to turn on glowing drawings and pentagrams all over, run the buildcubemaps, then turn them off again. And all your reflections will have an eerie look to them (also works with faked reflections of things that aren't there, like great aunt mary heh.

and I'm having tons of fun in the mapping section.. Had barely posted here before the SDK came out :D
the bit where u said you had barely posted before the sdk came out... well...

YOU ARE ON 11,359 POSTS :O :D :) crazy! lol that is S**T LOADS!

you the man thanks so much for clearing this up :D
 
commando said:
the bit where u said you had barely posted before the sdk came out... well...

YOU ARE ON 11,359 POSTS :O :D :) crazy! lol that is S**T LOADS!

you the man thanks so much for clearing this up :D
hehe yeah, i meant in the mapping section. Hardly really posted in this part.. I remember the days when it was right at the bottom hidden away on its own.
 
Back
Top