Problem with water and cubemaps.

MagicalMonkey

Newbie
Joined
Nov 23, 2004
Messages
69
Reaction score
0
I'm having a problem with water not reflecting the sky. I have a skybox which is just water, scaled up by a stupidly high factor with a tiny texture scale to balance out the size. When I run the map, the water reflects the sky. Then I type buildcubemaps and half the water goes black.

Before buildcubemaps:



And after:



Any idea what's happening/how to fix it? I'm running vis on fast and the other 2 on normal when I compile, if that's any help.
 
did you make the water properly? it has to be nodraw on all sides, except for the side showing which has water texture

as for the skybox, use the texture that literally says "skybox" on it. in map properties you can name the skybox you want to use.
 
Triggerhappy41 said:
did you make the water properly? it has to be nodraw on all sides, except for the side showing which has water texture

as for the skybox, use the texture that literally says "skybox" on it. in map properties you can name the skybox you want to use.

The water is made properly, and I'm using the texture which says skybox around both map and skybox (completely enclosing the skybox on all 6 sides), and I've chosen the apropriate skybox in map properties. I tried putting cubemaps inside the skybox, and the water becomes visible but reflects blue rather than the sky. I've tried this with the cubemap sampling both the skybox and the water. I'm using cheap water because expensive water won't render properly for some reason. I thought this might have something to do with it but the cheap water does reflect the sky in the first screenshot, so I don't think that has anything to do with it.

Any other ideas?
 
that might be it... when you build the cubemaps, check where the closest Env_cubemap to the water is ... when you buildcubemaps in console it'll reflect whatever is THERE at the env_cubemap.. so... if you want it to still reflect the sky, .. I *think* (in otherwords try the following at your own risk, and read everything to the end) you should place an env_cubemap in the skybox and then in the properties link it to the water surface (pick face option)... OR place an env_cubemap somewhere near the water's surface... AND/OR try playing with the resolution settings, maybe it could reflect the sky but it would just be a glossy blur
 
one thing you could try is going to the cubemaps properties and selecting brush faces. then click on the water face. Im not sure if you need to click on any skybox faces tho.
 
No new developments. Here's a screenshot of what it now looks like with cubemaps in the skybox:



And the positions of those cubemaps:



Yay imageshack.
 
hmmm so your whole level is just encased in the skybox? ... how about you... make another box outside of your main level enclosing box with a texture of the sky, put the env_map there, and then link it to the water surface?
 
first off you dont need your sky that high, just takes longer for the compile to run, place it just above the top of your map...second are you compiling with vvis on normal?

Tank
 
MrFoofles said:
hmmm so your whole level is just encased in the skybox? ... how about you... make another box outside of your main level enclosing box with a texture of the sky, put the env_map there, and then link it to the water surface?

I have a box with 5 skybox faces and 1 nodraw face which encases the map, and a box with 6 skybox faces which contains water and a sky_camera for the skybox. I'll try adding another box with just a cubemap and link it to the water.

tank said:
first off you dont need your sky that high, just takes longer for the compile to run, place it just above the top of your map...second are you compiling with vvis on normal?

Tank

MagicalMonkey said:
I'm running vis on fast and the other 2 on normal when I compile, if that's any help.
 
I think its a good idea to have the skybox texture on all faces of the skybox. keep nodraw away from skyboxes.
 
MagicalMonkey said:
I have a box with 5 skybox faces and 1 nodraw face which encases the map, and a box with 6 skybox faces which contains water and a sky_camera for the skybox. I'll try adding another box with just a cubemap and link it to the water.

you have to run vvis on normal for the cubemaps to work properly, sorry didnt see that post

run at vvis at normal
 
Triggerhappy41 said:
I think its a good idea to have the skybox texture on all faces of the skybox. keep nodraw away from skyboxes.

My skybox does have all skybox textures. I had it with a nodraw by accident and I started seeing stuff inside the map rendered in the skybox.

tank said:
you have to run vvis on normal for the cubemaps to work properly, sorry didnt see that post

run at vvis at normal

I'll try compiling with vvis normal and hope it works then. Thanks.
 
With vis running on fast this map takes around 30 seconds to compile. I left it for 3 hours compiling on normal and then decided to stop it. Should it really have made the time it takes to compile increase by over 36000%?
 
there are many many calculations... it's strange it went for 3 hours though I didn't see such complex geometry in your level? other than the sheer size of that box, it was gigantic, remember everything is scaled 16 times bigger in the skybox

another thing to keep in mind is the resolution of the env maps and the number of them, the greater the number of each will significantly raise the compilation time, .. best not to mess with the default env_cubemap settings, unless you don't want to waste processing power for a simple shiny glossy surface for instance, or want particular detail in a particular room with a higher resolution
 
MrFoofles said:
there are many many calculations... it's strange it went for 3 hours though I didn't see such complex geometry in your level? other than the sheer size of that box, it was gigantic, remember everything is scaled 16 times bigger in the skybox

The main reason I made my skybox so huge was to have a horizon-to-horizon stretch of water. If I make it smaller and add skybox fog to try and hide the water-sky texture seam it looks horrible, and if I remove the skybox entirely there's just a big white square under the map which is visible higher up. Any ideas?
 
Triggerhappy41 said:
what part of the compile process is it slow on? vis? rad?

vis. I'm not that bothered about it now. The water is no longer going black or blue, nor is it reflecting the sky, but it doesn't look awful, and I scaled the skybox down to try and help with compile times. For now I'll run vis on fast and hope that it'll make the water look pretty when I do it on normal.
 
MagicalMonkey said:
vis. I'm not that bothered about it now. The water is no longer going black or blue, nor is it reflecting the sky, but it doesn't look awful, and I scaled the skybox down to try and help with compile times. For now I'll run vis on fast and hope that it'll make the water look pretty when I do it on normal.

yes vis takes the longest to compile and the more geometery you have the longer it will take. your hoizon should stay the same no matter where you have your sky set to (i think!)...lowering the sky brings it closer to the water so it will look better, to get the fraction and reflection you want you need to compile using normal vis...it is part of map building, and second it make the map run better during gameplay (optimizes the map)

Tank
 
tank said:
yes vis takes the longest to compile and the more geometery you have the longer it will take. your hoizon should stay the same no matter where you have your sky set to (i think!)...lowering the sky brings it closer to the water so it will look better, to get the fraction and reflection you want you need to compile using normal vis...it is part of map building, and second it make the map run better during gameplay (optimizes the map)

Tank

Lowering the sky? This sounds useful. Can you explain in a bit of detail?
 
Only thing with lowering the sky is throwing grenades at it causes them to bounce off the invisible wall...any way to stop this?
 
Lowering the sky in the 3d skybox would not make any difference to the height of the sky in the playable area, nor would the reverse have any effect. If your skybox is just a huge expanse of water, then I'd suggest making the water in the 3d skybox area 8 units high, placing the env_cubemap and skybox_camera at center of the the water brush in the top down view, one unit above the surface of the water, and then having the roof of the skybox one unit one unit above that.

Your playable area would then be elsewhere and the skybox can be as high as you damn well please. I'll try to recreate what I'm talking about and if I can get it to work right I'll attach it here.
 
Ok I've just run what I meant through hammer and then HL2.

As you can see from the screenshot is that it mostly works. All of that water is skybox, it stretches out from horizon to horizon, the player has more than enough room to fire objects upwards and not hit any invisible walls and the map still compiles extremely quickly (only a few seconds on a p4 3.0ghz machine with hyperthreading enabled).

But what you don't see in that screenshot is that there are some very weird things going on here... The lighting on the water off in the distance seems to be flashing as if a light is being turned off and on. If I look up at the horizon, I can see the reflection of what appears to be a building on top of a cliff. When I turn, this reflection turns with me, creating a very weird effect... If I look even further up I get what is nearly a hall of mirrors effect from the old HL1 days. At first I thought this was because I had skybox underneath the water and it was trying to refract the void, so I textured the brush under the water with toolsblack and still got the same effect... So I changed the material I was using for the water from dev/water2 to nature/water_canals_water_murky and still nothing changed. Even recompiling the cubemap didn't help... I haven't yet tried doing this with a cheap water material though.

I have attached the .vmf file so that you can see for yourself how I did this in hammer. You'll probably want to have some detailed real water near the edges of the world for the player to wade into and then place the skybox water further away to hide the lack of detail due to the change in texture scale... But I think this wont work because source can only render one block of water at a time (which is why you can only have one water brush per PVS, which I guess must mean Personal Viewable Space or something like that).

I'm not sure how Valve did their water going off into the horizon in HL2.... I'll do a little investigating and get back to you on it... In the meantime, good luck :)
 
Wow ok... That's some mind-boggling stuff right there....

Run HL2, bring up the console and use the map command to go to d2_coast_05. Noclip off the side of the cliff and then go around the cliff while over the water... Half the level will be missing! If you don't stay low and over the road as you roam around the level, you'll miss triggers that seem to change where all the hint brushes are! Crazy, crazy stuff...

Anyways, in that map they didn't even use a 3d skybox at all... They just had one massive long stretch of water that went on past the max distance of the fog in that level... You can clearly see the square edges of the water if you noclip out far enough.
 
Back
Top