This article's documentation is for anything that uses the Source engine. Click here for more information.

func_reflective_glass

From Valve Developer Community
Revision as of 19:14, 20 June 2024 by BetweenReality (talk | contribs) (Fix loose brackets)
Jump to navigation Jump to search
func_reflective_glass (Note how NPC's and env effects are reflected)

func_reflective_glass is a brush entity available in all Source Source games.

Entity description

It is used to produce perfectly reflective glass that renders world + entities. You must use a Shader-ball.png LightmappedReflective texture (🖿glass/reflectiveglass001.vmt is a good start) on one side of the brush, and the rest of the sides either nodraw or some other opaque texture for this to work properly. It is functionally identical to expensive water shaders, but typically used with opaque, flat materials.


Note.pngNote:This entity will not show a player their own reflection in first person (except in Garry's Mod), but it will render all player models that are actually being drawn.
Note.pngNote:This entity may be constructed from more than one brush, but all LightmappedReflective faces must be on the same Wikipedia icon plane to work as intended.
Icon-Bug.pngBug:CSM shadows do not render on the brush.  [todo tested in ?]
Icon-Bug.pngBug:This entity will always be drawn in front of translucent textures, including particles and sprites.  [todo tested in ?]
Icon-Bug.pngBug:This entity will cease to render or cause visual artifacts if expensive water and or func_areaportals are in a visible visleaf (meaning they can see each other).  [todo tested in ?]
Icon-Bug.pngBug:If more than one face of this brush entity contain a reflective or translucent texture, then the mirror's behavior will suddenly switch depending on one's perspective. To prevent this, make sure exactly one surface has the reflective texture. All others must be opaque.  [todo tested in ?]
Icon-Bug.pngBug:In Portal Portal, unless r_portal_stencil_depth is set to 0 (which disables portal rendering):
  • Having linked portals present near the mirror, or if they are present anywhere within the players' view range (even if they are not being reflected) will cause heavy visual artifacts. The effects are more intense if more portals are reflected and/or more portals are within the players' view range.
  • The view through portals renders incorrectly or not at all when viewed through a mirror.
  • If a mirror is viewed through a portal, the mirror will still reflect based on the players' absolute position rather than the relative position from the other portal, which causes the mirror to display inaccurately.
  • If r_portal_stencil_depth is greater than 2, the game may crash when attempting to look through portals that can see each other and the mirror.
  [todo tested in ?]
Warning.pngWarning:In Black Mesa, LightmappedReflective doesn't work (shows wireframe instead of surface with reflection). Despite this, the entity still creates the reflection camera.
Tip.pngTip:To keep the framerate high, use triggers to disable the entity while not needed.

Keyvalues

Solidity (Solidity) <choices>
Used to control the solidity/collision of these brushes.
Icon-Bug.pngBug: Physics objects can behave oddly when placed directly on top of this brush, to prevent this make this brush never solid and add invisible or clip brush floor on top.  [todo tested in ?]
  • 0: Toggle - The solidity can be toggled together with its visibility.
  • 1: Never Solid
  • 2: Always Solid
Solid BSP (solidbsp) <boolean>
Set this to BSP if the player seems to rotate oddly relative to the surface.
NPC class excluded from collisions (excludednpc) <classname>
If an NPC classname (i.e. npc_zombie) is specified here, NPCs of that type won't collide with these brushes.
Invert NPC class exclusion (invert_exclusion) <boolean>
If set, then the excluded NPC class will consider this brush solid, and all other NPC classes will consider it non-solid.
Start Disabled (StartDisabled) <boolean>
Stay dormant until activated (with theEnableinput).
Tip.pngTip:If Solidity is Toggle, disabling will also make the entity non-solid.
Red x.png
This template (and its redirect) is Wikipedia icon Deprecated. Its use is not recommended and its functionality may be compromised.
Please use {{Brush rendering note}} instead.
You can help our editors by replacing or deleting this template on the Pages that use this template. Once no more pages use this template, it should be Marked for deletion.
Note.pngNote:Archived page history
Icon-Important.pngImportant:These pages are linked often from page history logs so Special:WhatLinksHere will not show anything.


Flags

  • 2: Ignore player +USE - Entity will ignore all Use inputs, including ones from the player.

Inputs

SetExcluded
Change the NPC class that does not collide with the brush.
SetInvert
Whether to reverse the NPC class exclusion rule.

EnableDisable:

Enable / Disable
Enable/disable this entity from performing its task. It might also disappear from view.
SetDamageFilter <targetnameRedirectInput/string>
Sets a filter for this entity for when it receives damage.
EnableDamageForces
Allows the entity to be pushed by damage done to it (usually force amount correlates with the damage done).
DisableDamageForces
Prevents the entity from being pushed by damage done to it.
Todo: move/mention at proper place


Outputs

See also