WindowImposter: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created page with "'''<code>WindowImposter</code>''' acts pretty much like UnlitGeneric, except that any specular reflections applied to it will be force drawn no matter the user...")
 
(formatting)
 
(16 intermediate revisions by 8 users not shown)
Line 1: Line 1:
'''<code>WindowImposter</code>''' acts pretty much like [[UnlitGeneric]], except that any [[$envmap|specular reflections]] applied to it will be force drawn no matter the user settings or console commands used, like <code>mat_specular 0</code>.
{{stub}}
'''{{code|WindowImposter}}''' accepts only [[$envmap]] which is force drawn no matter the user settings or console commands used, like {{cmd|mat_specular|0}}.


{{note|Does accept some parameters in {{gmod|4}}, such as [[$alpha]]}}
{{todo|Which parameters? Other branches?}}
The faces' orientation isn't taken into account when reflecting the [[Cubemap|cubemap]], which makes it very convenient for making multiple fake skyboxes.
In {{hl2|4}}, {{code|WindowImposter}} is used by the material {{path|icon=file|dev/dev_windowportal.vmt}}, and used extensively on {{ent|func_illusionary}} or {{ent|func_brush}} entities in conjunction with {{ent|func_areaportalwindow}}.
{{warning|The cubemap will have broken/corrupted colors on [[HDR|HDR lighting]] if you don't have a [[HDR]] texture 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 {{code|.hdr}} to the name. This texture needs to be in [[VTF_(Valve_Texture_Format)#Image_data_formats|RGBA16161616F]] format. For example if your cubemap is named {{path|icon=file|mystuff/coolsky.vtf}}, you should have the HDR version named as {{path|icon=file|mystuff/coolsky.hdr.vtf}}. The game will automatically load the HDR version and fallback to the normal texture for LDR clients.}}
{{warning|This shader ''only'' works on [[brushes]] and [[Displacement|displacements]].}}
== Example VMT ==
<syntaxhighlight line>
WindowImposter
{
"$envmap" "space/space_envmap"
}
</syntaxhighlight>


[[Category:Shaders]]
[[Category:Shaders]]
[[Category:Stubs]]
[[Category:Stubs]]

Latest revision as of 09:15, 28 May 2025

Stub

This article or section is a stub. You can help by expanding it.

WindowImposter accepts only $envmap which is force drawn no matter the user settings or console commands used, like mat_specular 0.

Note.pngNote:Does accept some parameters in Garry's Mod Garry's Mod, such as $alpha
Todo: Which parameters? Other branches?

The faces' orientation isn't taken into account when reflecting the cubemap, which makes it very convenient for making multiple fake skyboxes.

In Half-Life 2 Half-Life 2, WindowImposter is used by the material Filedev/dev_windowportal.vmt, and used extensively on func_illusionary or func_brush entities in conjunction with func_areaportalwindow.

Warning.pngWarning:The cubemap will have broken/corrupted colors on HDR lighting if you don't have a HDR texture 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 Filemystuff/coolsky.vtf, you should have the HDR version named as Filemystuff/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.

Example VMT

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