WindowImposter

From Valve Developer Community
Jump to navigation Jump to search
This article or section is a stub. You can help by expanding it.

WindowImposter is a Vertex shader available in all Source Source games. It displays an $envmap which is drawn regardless of user settings such as mat_specular.

Note.pngNote: In first-party games, it only accepts $envmap.
Garry's Mod Garry's Mod accepts extra parameters, such as $alpha.
Todo: Any other parameters? Do branches have extra parameters as well?

The faces orientation isn't taken into account when reflecting the cubemap, which makes it very convenient for making windows/doors that hide everything behind them while looking like they aren't, as well as faking having multiple simultaneous skyboxes.

In Half-Life 2 Half-Life 2, WindowImposter is used by the material dev/dev_windowportal.vmt, and used extensively on func_illusionary and func_brush entities in conjunction with func_areaportalwindow to reduce the amount of geometry rendered in outside areas.

Warning.pngWarning: Custom cubemaps will have broken/corrupted colors on HDR lighting if you don't have a HDR version supplied. To fix this, you must generate a HDR version of your cubemap/skybox texture. Name this HDR version the same as your normal texture, but add .hdr to the name. This texture needs to be in RGBA16161616F format. For example if your cubemap is named mystuff/coolsky.vtf, you should have the HDR version named as mystuff/coolsky.hdr.vtf. The game will automatically load the HDR version and fallback to the normal texture for LDR clients.
Warning.pngWarning: This shader only works on brushes and displacements.
PlacementTip.pngWorkaround: For studio models, use VertexLitGeneric without a $basetexture. The material will be unlit if $basetexture is omitted.
Confirm:Does UnlitGeneric work as well?
Example of failing to set up WindowImposter in a test map.

Example VMT

WindowImposter
{
	"$envmap" "space/space_envmap"
}

See the $envmap page for instructions on creating custom $envmaps for this shader.

See also