Improper Slime Water Reflections

Avatar
DigitalMan
17 Posts
Posted Jan 26, 2012
I was just working on my maps and I noticed that there were indicator lights and warm lights reflecting on the slime water through the wall. They aren't in the same room, yet they are showing on the water. This problem persists when I compile the map in HDR and even if I build cubemaps. It also only happens on Low - Med Shadow Detail settings. Screenshot attached below. Thanks in advance.

cat_singleplayer0000.jpg

Images 1
Post image 1
Advertisement
Registered users don’t see ads! Register now!
Avatar
Moth
225 Posts
Posted Jan 26, 2012
Replied 1 hour later
Which water texture are you using? Does it have Nodraw on all sides except the visible one?
Avatar
DigitalMan
17 Posts
Posted Jan 26, 2012
Replied 8 minutes later
I am using nature/toxicslime002a and yes, I have the nodraw texture on every side except the top.
Avatar
Moth
225 Posts
Posted Jan 26, 2012
Replied 7 hours later
Did you place a water_lod_control entity? and water doesn't display properly unless you do a proper full RAD compile (not FAST). Try changing your water texture to the 'laser-over-goo' one, since that one is known to work fine. Rule these things out and then get back to me :smile:
Avatar
DigitalMan
17 Posts
Posted Jan 26, 2012
Replied 1 hour later
Yes, I do have a water_lod_control in my map and I also compile my map with all settings on Normal, including RAD. I tried switching the texture to the laser over goo one and it still kept those reflections. It's reflecting what I want along with some other things that I don't want to because they are in a separate room. I guess water isn't really one of my strong points.
Avatar
DigitalMan
17 Posts
Posted Jan 27, 2012
Replied 1 day later
So I've been testing and maybe it would be fixed if the cubemaps were actually built. I don't know why, but the cubemaps don't want to be built. I compile on FINAL in the expert compiler and then type buildcubemaps in the console, but the map looks exactly the same as it was before the cubemaps were built. I know there are a couple other threads on here about that, but they haven't helped me either.
Avatar
Brainstatic
219 Posts
Posted Jan 27, 2012
Replied 37 minutes later
It could be caused by your graphics settings. If your graphics settings are below a certain threshold, most things won't render in water reflections. World brushes are included in the things that won't render. As a result, your indicator lights and glass lights render in the reflection through the wall.
Avatar
DigitalMan
17 Posts
Posted Jan 27, 2012
Replied 14 minutes later
That makes sense, but I keep wondering how Valve has managed not to have this happen in any of there maps. I play on close to lowest settings (my computer doesn't have a graphics card, only motherboard graphics) and Valve's reflections still look good and reflect the correct things.
Avatar
Brainstatic
219 Posts
Posted Jan 27, 2012
Replied 6 minutes later
With some entities, you can fire inputs to enable or disable fast reflections or just adjust the keyvalues as necessary. Also, Valve mostly avoided halls or outcroppings in reflective slime pits through which entities on the other side could easily reflect.
Avatar
Robdon
204 Posts
Posted Jan 28, 2012
Replied 20 hours later
Hi,

I've spent quite some time trying to get my reflections right recently.

There seems to be some bugs and things regarding them.

The 'problems' seem to be effected by the 'Shader Details' settings in the main video settings.

Low - No Reflections
Medium - Reflect just 'lights', including props like lasers, lightbridges, indicator lights etc.
High - Lights + Brushes
Very High - Not sure what else this adds

However, there must be some way to override these settings in the code or compile. Because Valve do it. For example, in sp_a2_brige_intro, even if you have Shader Details set to 'Low' you still get reflections in the water. But if I decompile that map, and recompile it, the new compile then doesnt override the settings, and reflections stop when on 'low' and 'medium'.

Then there are some bugs:

If you have the settings set as 'Medium' then it doesnt reflect the Brushes you have around the water as it should, BUT it also then makes all those Brushes not block light from any light entities, so they reflect on the water. I'm guessing this is why Valve have forced their water to always reflect in their maps somehow.

img

One way around it is, you could set all your Brushes that are around the water to func_brushes, and then force them to reflect buy setting the 'Render In Fast Reflections'. That seems to make it work better.

Also, there is a problem with reflections on the 'edge' of the water.
If you have an entity that emits light near water but blocked by a brush, and you move to certain angles, then it doesnt actually reflect in the water, but it does reflect a little bit of its light along the edge of the water. This happens in Valves maps also in some places.

img

There is a way around it though.

Its a bit difficult for me to word it, so its probably better to look at the attached example I've knocked up to test it.
It seems that the light leaks through brushes on the edge of the water. So we need to block them with brushes that have a texture. I picked tools/toolsblack.

If you look at the map attached:

Point '1' has no 'fixes' and in 'medium' shader mode you will see the lightbridge, laser and indicator lights reflecting in the water when you shouldn't, however in high or very high mode you dont see them.

Point '2' has the fix to stop those reflections in 'medium' mode (By making the brushes that should block the light a func_brush and setting the 'Render In Fast Reflections' property), but there is still a small amount of light leakage on the edge of the water at certain angles. noclip around and you should be able to see them come and go. If you cant find a point where you can see them, then noclip up to the ledge at the end near the point '4' and face them while your feet are on the white bar up there.

img

Point '3' has the above fix and also the one to stop light leaking (This is done by putting another func_brush with 'Render In Fast Reflections' property set and the bottom textured with 'tools/toolsblack' and sides and top with nodraw, 8 units thick, and placed ontop of the floor brush. There should be no reflections from the lights above or leakage now.

HTHs,

Rob.

Attachments
reflections.zip
1.33 MB 50 downloads
Avatar
Robdon
204 Posts
Posted Jan 29, 2012
Replied 21 hours later
Hi,

Ok a bit more info on the first problem, where light entities seem to not get blocked when in 'Medium' mode.

I've spent today trying to figure out what the difference waw between me compiling and Valve compiling.

Using pakrat I found that Valves bsp files all have the following extra files in them, that arnt in the bsp if I compile it.

simpleworldmodel.mdl
simpleworldmodel.dx90.vtx
simpleworldmodel.vvd
simpleworldmodel_water.mdl
simpleworldmodel_water.dx90.vtx
simpleworldmodel_water.vvd
simpleworldmodel.vmt
simpleworldmodel.pwl.vtf
simpleworldmodel.vtf
simpleworldmodel_albedo.pwl.vtf
simpleworldmodel_albedo.vtf
simpleworldmodel_lightmap.pwl.vtf
simpleworldmodel_lightmap.vtf

Every single one of Valves bsp files have these, but no one else do.

If I extract them from Valves bsp they are actually models of the whole map but just flat purple textures for faces, I'm guessing its being used to block light and reflections, and are built at some point.

If I then inject them into my compiled version with pakrat, my compiled version blocks the light entities like valves map does. (The leaking bits of light dont get fixed though, that defiantly looks like a bug)

I then found the console command buildmodelforworld

This command fails though with:

] buildmodelforworld
Compilation of "c:\program files (x86)\steam\steamapps\common\content\portal2_dlc1\materialsrc\models\maps\sp_a2_bridge_intro/simpleworldmodel.tga" succeeded
Compilation of "c:\program files (x86)\steam\steamapps\common\content\portal2_dlc1\materialsrc\models\maps\sp_a2_bridge_intro/simpleworldmodel_lightmap.tga" succeeded
Compilation of "c:\program files (x86)\steam\steamapps\common\content\portal2_dlc1\materialsrc\models\maps\sp_a2_bridge_intro/simpleworldmodel_albedo.tga" succeeded
Compilation of "c:\program files (x86)\steam\steamapps\common\content\portal2_dlc1\models\maps\sp_a2_bridge_intro/simpleworldmodel_water.qc" succeeded
Compilation of "c:\program files (x86)\steam\steamapps\common\content\portal2_dlc1\models\maps\sp_a2_bridge_intro/simpleworldmodel.qc" succeeded
Unable to remove c:\program files (x86)\steam\steamapps\common\portal 2\portal2_dlc1/models/maps/sp_a2_bridge_intro/simpleworldmodel.mdl! (errno 2)
Unable to remove c:\program files (x86)\steam\steamapps\common\portal 2\portal2_dlc1/models/maps/sp_a2_bridge_intro/simpleworldmodel.dx90.vtx! (errno 2)
Unable to remove c:\program files (x86)\steam\steamapps\common\portal 2\portal2_dlc1/models/maps/sp_a2_bridge_intro/simpleworldmodel.vvd! (errno 2)
Unable to remove c:\program files (x86)\steam\steamapps\common\portal 2\portal2_dlc1/models/maps/sp_a2_bridge_intro/simpleworldmodel_water.mdl! (errno 2)
Unable to remove c:\program files (x86)\steam\steamapps\common\portal 2\portal2_dlc1/models/maps/sp_a2_bridge_intro/simpleworldmodel_water.dx90.vtx! (errno 2)
Unable to remove c:\program files (x86)\steam\steamapps\common\portal 2\portal2_dlc1/models/maps/sp_a2_bridge_intro/simpleworldmodel_water.vvd! (errno 2)
Unable to remove c:\program files (x86)\steam\steamapps\common\portal 2\portal2_dlc1/materials/models/maps/sp_a2_bridge_intro/simpleworldmodel.pwl.vtf! (errno 2)
Unable to remove c:\program files (x86)\steam\steamapps\common\portal 2\portal2_dlc1/materials/models/maps/sp_a2_bridge_intro/simpleworldmodel.vtf! (errno 2)
Unable to remove c:\program files (x86)\steam\steamapps\common\portal 2\portal2_dlc1/materials/models/maps/sp_a2_bridge_intro/simpleworldmodel_albedo.pwl.vtf! (errno 2)
Unable to remove c:\program files (x86)\steam\steamapps\common\portal 2\portal2_dlc1/materials/models/maps/sp_a2_bridge_intro/simpleworldmodel_albedo.vtf! (errno 2)
Unable to remove c:\program files (x86)\steam\steamapps\common\portal 2\portal2_dlc1/materials/models/maps/sp_a2_bridge_intro/simpleworldmodel_lightmap.pwl.vtf! (errno 2)
Unable to remove c:\program files (x86)\steam\steamapps\common\portal 2\portal2_dlc1/materials/models/maps/sp_a2_bridge_intro/simpleworldmodel_lightmap.vtf! (errno 2)
*****************It is recommended to quit the game after running buildmodelforworld!  Leaks rendertargets!****************

But, it does actually inject simpleworldmodel.vmt into the bsp file before it fails, so it seems like its something to do with it.

I cant find anything on Google about buildmodelforworld or simpleworldmodel.

I think it has something to do with either buildmodelforworld or some switch or something to get VRAD to add in the simpleworldmodel somehow maybe, but I cant figure it :sad:

If anyone else has any clues?

Rob.

Avatar
spongylover123
944 Posts
Posted Jan 29, 2012
Replied 1 hour later
I think buildmodelforworld is like buildcubemaps, the dlc broke it.
Avatar
Robdon
204 Posts
Posted Jan 29, 2012
Replied 6 minutes later
Buildcubemap works though, you just have to have your map in the portal2_dlc1\maps dir

Buildmodelforworld is the same, it only updates maps in portal2_dlc1\maps since the dlc.

Maybe they broke it more... but I cant find ANY map, even that was built before the dlc that has this simpleworldmodel in them, apart from Valves.

Rob.

Avatar
Vordwann
767 Posts
Posted Jan 30, 2012
Replied 1 day later
What i've always wondered is why Valve's refract textures (glass, water, etc.) arent' programmed better. Right now they draw refractions not only from objects behind them, but objects on top of them such as cubes, the viewmodel, etc.

EDIT: Woah i'm a community contributor... didn't notice that :smile:

Avatar
spongylover123
944 Posts
Posted Jan 30, 2012
Replied 1 hour later

Robdon wrote:
Buildcubemap works though, you just have to have your map in the portal2_dlc1\maps dirBuildmodelforworld is the same, it only updates maps in portal2_dlc1\maps since the dlc.Maybe they broke it more... but I cant find ANY map, even that was built before the dlc that has this simpleworldmodel in them, apart from Valves.Rob.

Try some maps for other source games.

P.S The commands work, but they dont function, I cant see my cubemaps, even though I have built them. so are for the buildmodelforworld, if only someone still has pre-dlc p2

Avatar
kwp21 pitts
260 Posts
Posted Jan 31, 2012
Replied 1 day later
Try to moving the env_cubemap entity lower.
Avatar
Robdon
204 Posts
Posted Feb 01, 2012
Replied 19 hours later

spongylover123 wrote:
Robdon wrote:

Buildcubemap works though, you just have to have your map in the portal2_dlc1\maps dirBuildmodelforworld is the same, it only updates maps in portal2_dlc1\maps since the dlc.Maybe they broke it more... but I cant find ANY map, even that was built before the dlc that has this simpleworldmodel in them, apart from Valves.Rob.

Try some maps for other source games.

P.S The commands work, but they dont function, I cant see my cubemaps, even though I have built them. so are for the buildmodelforworld, if only someone still has pre-dlc p2

Hmm, well they work for me, so I guess something isn't quite right.

Check this:

Firstly, make sure you have gotten rid of any bsp files of your map in the dirs. Portal will look for bsp files in this order and these dirs, so check them, baring in mind these paths are for Win 7 64, so you might need to change the 'program files (x86)' bit to 'program files':

C:\program files (x86)\steam\steamapps\common\portal 2\update\maps\yourmap.bsp
C:\Program Files (x86)\Steam\SteamApps\common\portal 2\portal2_dlc1\maps\yourmap.bsp
C:\Program Files (x86)\Steam\SteamApps\common\portal 2\portal2\maps\yourmap.bsp
C:\program files (x86)\steam\steamapps\common\portal 2\platform\maps\yourmap.bsp

Then, to make it easier for building cubemaps and things its probably best if you change hammer to automatically copy the bsp file to the 'C:\Program Files (x86)\Steam\SteamApps\common\portal 2\portal2_dlc1\maps' dir when you compile, since the buildcubemap command will only try to write back to the bsp in that dir. (and will crash portal if the file isnt there)

So close portal and hammer, and edit the file C:\Program Files (x86)\Steam\SteamApps\common\portal 2\bin\GameConfig.txt in notepad and change the following line:

"BSPDir" "C:\Program Files (x86)\Steam\SteamApps\common\portal 2\portal2\maps"

to

"BSPDir" "C:\Program Files (x86)\Steam\SteamApps\common\portal 2\portal2_dlc1\maps"

Now hammer will copy your bsp file to the dlc1 dir when you compile, so you dont need to move it around and stuff when building cubemaps.

In hammer place your cubemaps and stuff, and then compile, make sure you are in 'expert' mode and you select the 'Full compile -both -final (slow!) config

Now start portal and type the following in the console.

map yourmap
mat_hdr_level 2
buildcubemaps
mat_hdr_level 1
buildcubemaps
mat_hdr_level 2

Thats it, they should be there now.

If you recompile or rename the bsp file, you will need to do the build again, as this destroys the cubemaps.

I would recommend also closing and reopening portal each time you re-compile and change env_cubemaps or things. Sometimes portal seems to 'cache' the cubemaps and sometimes it doesnt. If it does then it can confuse you as to what your last change actually did or didnt do.

Note that cubemap reflections will only show if your settings for 'Shader Detail' are 'high' or 'very high', they wont show in Medium.

Also, not all entities will reflect in cubemaps, for instance env_portal_laser doesnt display correctly and only 2 red points will reflect at the origin and at the end point that the laser hits something. The actual laser 'line' wont reflect.

Another thing that can be helpful is to use the cubemap weapon. Have a look at bottom of this thread at Skotty's post and it will give you a link to getting the weapon and how to install/use it. Its a good tool for seeing which cubemap is active and what it can see.

http://forums.thinking.withportals.com/mapping-help/buildcubemaps-crashes-game-t4828-30.html

I've attached some demo vmfs, to show some reflections from cubemaps, and some prebuilt bsp files with cubemaps built and also not built to show the differences.

The best things to use for testing are glass vactubes and lightbridges

cubemap1: no env_cubemap in map
img
cubemap2: env_cubemap in map, but no cubemaps built
img
cubemap3: env_cubemap in map, and cubemaps built
img

Bare in mind, I've set my cubemap in hammer to have a size of '256x256' which can cause possible performance problems because its the highest quality. Its just so that it shows a good image of it in this test and its a simple map. I'm not sure 'how' bad this is for performance so you need to test which is the best for your map and performance, or just use 'standard'.

HTHs,

Rob.

Attachments
cubemaps.zip
2.87 MB 42 downloads
Avatar
Another Bad Pun
516 Posts
Posted Feb 01, 2012
Replied 26 minutes later
If you have multiple goo pits, make sure it isn't all one big brush. Having it all one big brush can cause reflection problems like yours.
Avatar
DigitalMan
17 Posts
Posted Mar 28, 2012
Replied 1 month later
This thread died a little while back, but I thought I'd revive it to share a few things I found out relating to the subject. I'm not sure if it's new to any of you, but I figured I'd share anyway. I decided to take several screenshots of one of the maps in Portal 2. The map I chose was sp_a2_bridge_intro.

I started with the original version from the game and took a shot showing most of the area and another of just the water. I also took these on both Low and High shader detail.

After doing that, I renamed the map file and retook the screenshots from the same areas as I took the others. Aside from the cubemaps being broken, the map looked the same on High shader detail. When I put it on Low, I noticed the water wasn't the same as it was before in the original. So if the water gets broken because of the rename, could that mean that there's a file somewhere (perhaps in one of the several vpks) that controls this?

I could have stopped there, but I didn't. I decided to decompile the map and do a full recompile to see what happened. So I recompiled the map under a different name and found that the map was a lot darker than the one in Portal 2. I also noticed that the water has weird marks all over it on High Shader detail, but they aren't present on Low. Now not every decompile is perfect, but could this also mean that Valve had some sort of special compile tool to make the maps appear the way they do?

Then to finish the little project I was doing, I decided to rename the file to the official name and found the same results as the one above. It should be noted that these were taking without building the cubemaps. I was going to take more with the cubemaps built, but I didn't have the time to do so.

I still have all the screenshots and I can try to post them here later today if you want to see them. Thanks for reading.

Advertisement
Registered users don’t see ads! Register now!
Avatar
Robdon
204 Posts
Posted Mar 28, 2012
Replied 1 hour later
Hi,

What decompiler are you using and what version?

A while ago, I found a bug in BSPSource, that it was converting all boolean parameters to 'true'/'false' text instead of 0/1, and reported it to them.

This caused errors with those parameters, because the compiler takes 'false' and 'true' and turns them both in to '0', ie disabled.

This specifically effects lighting (but not only), because the models used for glass panels (glass_lightcover) have to have the 'Disable Shadows' set on the model, so that the light panel behind them shines through.

So because of this bug, all the glass_lightcover wont allow light to pass and therefore decompiled maps are always darker if light panels are used.

This was recently fixed in BSPSource release 1.3.4, so check your version and update if needed and re-decompile your maps.

http://ata4.info/bspsrc/downloads.html

Hopefully this should help the lighting and maybe other problems.

Rob.