Editing and Customization > Modding Help

Cubemap reflection issue


One of the issues I have in my Subpen map is that the cubemap reflections for the corridor part aren't working correctly. In the original version of the map it looked like this:

In my version it looks like this (sorry for the dark screenshots, it looks brighter in-game):

There are basically two main materials used here. The first one is the metal texture which uses cubemaps to achieve this shiny/glossy metal effect. The vmt file looks like this:

--- Code: ---
"$basetexture" "Subpen/green_metal"
"$surfaceprop" "Metal"
"$envmap" "env_cubemap"
"$envmaptint" "[.5 .5 .5]"
--- End code ---

The second material is the blue light texture on the lamp/light props. The vmt file for the material looks like this:

--- Code: ---
"$basetexture" "models/props/subpen/corridorLight"
"$selfillum" "1"
"$selfillummaskscale" "1.0"
--- End code ---

Either way, I have three issues I hope to get solved.
The first one is pretty obvious and can be seen in the in-game screenshot. There is a blurry weird looking reflection of the light/lamp prop. I don't know exactly what causes it (although it is clearly related to the cubemaps). I tried increasing the number of cubemaps, decreasing the number of cubemaps, changing which faces the cubemaps are assigned to and so on but so far I haven't gotten rid of this weird reflection. Actually the only way I found to get rid of this issue is to change from prop_static to prop_dynamic_override, in which case it looks like this:

In this case there are no reflections at all, not even in the scope of the moonraker. It gets rid of the problem but it looks dry.

A somewhat related issue is that I want to be able to decrease the intensity of lamp/light texture. It shouldn't be as bright as it is. I've looked into it a bit but I'm still not sure how it's done.

The third issue is that when applying a material using cubemaps on certain brushes there are weird edges visible. This can be clearly seen in these images:

I have no idea what causes these.

When changing a prop_static to anything like prop_dynamic or prop_physic you will exclude it from cubemap reflection completly.

The reson is simple: a cubemap is a static image capture of the scene, so any potentially moving objects are excluded.

IMO, the reflections look a bit lowres and could be toned down to maybe .25, too.

To understand what is causing these distortions, please go ingame use sv_cheats 1 and mat_wireframe 1 when looking at the issue.

I'm pretty sure it`s related to how the compiler is creating triangled geometry from the brushwork.
Also check these parts in Hammer with show lightmap grid enabled in 3D view and loaded portalfile.

If lightmaps are not properly aligned or a vis leaf cuts through there, it might be causing this to happen.

I solved the weird texture edge issue mostly by adjusting the lightmap scale and sometimes rotating the texture (which works for some reason). I "solved" the weird reflection issue by setting the light/lamp props to prop_dynamic_override so that they aren't included in the cubemap reflection. Maybe I will change it later but for now this is the simplest and best solution (getting the proper reflections (if possible) seems like a lot of work).

Edit: The remaining issue is whether or not I can adjust the intensity of the self-illuminating texture on the light/lamp prop.


[0] Message Index

Go to full version