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

Env screenoverlay: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (removing yoda speak)
(position in the world irrelevant so it's logical entity)
 
(35 intermediate revisions by 24 users not shown)
Line 1: Line 1:
{{wrongtitle|title=env_screenoverlay}}
{{LanguageBar}}
{{base_point}}[[Category:GUI Entities]]
[[File:env_screenoverlay.jpg|thumb|320px|right|An <code>env_screenoverlay</code> with <code>effects/combine_binocoverlay</code> on {{ent|d2_coast_03}}.]]
[[Category:Special effects]]
{{CD|CEnvScreenOverlay|file1=env_screenoverlay.cpp}}
{{This is a|logical entity|name=env_screenoverlay|engine=Source}} It can display and control a set of [[screen overlays]], to be displayed over the player's view. Useful for view effects like drunkenness, or teleporter afterimages, etc.
 
{{note|An overlay will be applied to all players in multiplayer games, even when the{{ent|!activator}}is one player. To apply an overlay to a single client, the command <code>r_screenoverlay <material_path></code> needs to be used with a {{ent|point_clientcommand}}.
}}


[[Image:env_screenoverlay.jpg|thumb|300px|right|env_screenoverlay in practice using effects/combine_binocoverlay]]
{{note|In {{portal2}}, screen overlays are disabled by default. You must set <code>r_drawscreenoverlay 1</code> to enable.}}


== Entity description ==
{{note|In {{tf2}}, the overlay can be overridden by certain actions such as being ubercharged or burned. The <code>SetScriptOverlayMaterial</code> input or [[Team Fortress 2/Scripting/Script Functions#CBasePlayer|VScript function]] on the [[player]] can be used to set a separate overlay that will not be overriden by such actions.}}
An entity that can display and control a set of screen overlays, to be displayed over the player's view. Useful for view effects like drunkenness, or teleporter afterimages, etc.
{{note|An overlay will be applied to all players in multiplayer games.}}


== Materials ==
==Materials==
You can use any material as an overlay, but <code>[[UnlitGeneric]]</code> ones are recommended to avoid artefacting.
You can use any material as an overlay, but {{ent|UnlitGeneric}} materials are the least likely to have any visual bugs.


Valve provide these materials in the <code>/effects</code> folder:
{{tip|You can create ''custom'' pixel shaders for the overlay and pack them with the map. See [https://github.com/ficool2/sdk_screenspace_shaders sdk_screenspace_shaders] for more details.}}


Valve provides these materials in the <code>/effects</code> folder:
;combine_binocoverlay
;combine_binocoverlay
:Combine binoculars
:Combine binoculars
Line 19: Line 22:
:Green teleport shimmer
:Green teleport shimmer
;tp_eyefx/tpeye2
;tp_eyefx/tpeye2
Red teleport shimmer
:Red teleport shimmer
;tp_eyefx/tpeye3
;tp_eyefx/tpeye3
:Blue teleport shimmer
:Blue teleport shimmer
;tp_eyefx/tp_eyefx
;tp_eyefx/tp_eyefx
:Drugged distortion
:Warped distortion, somewhat similar the one seen on [[strider]] charge shots.
;tp_eyefx/tp_black
;tp_eyefx/tp_black
:Black. A probable bug makes it so that a thin border around the overlay is still visible.
:Black. A thin border around the overlay is still visible.
;tp_eyefx/tp_eyefx_eli
;tp_eyefx/tp_eyefx_eli
:Flashing animation of three figures. Hardly usable as an overlay.
:Flashing animation of three figures. Hardly usable as an overlay.
Line 39: Line 42:
;models/props_combine/portalball001_sheet
;models/props_combine/portalball001_sheet
:Green downward haze
:Green downward haze
;effects/tp_refract
:Red/Orange Refractive overlay
;glass/glasswindow_refract01
:As if looking through a glass Observation window from Portal


== Keyvalues ==
==Flags==
* {{KV Targetname}}
{{fl|1|Allow Suit Zoom|nofgd=1}}
* '''OverlayName''(1-10)'''''
: <material> Name of the overlay material to display.
* '''OverlayTime''(1-10)'''''
: <float> Amount of time that the overlay should be displayed for, after which it will begin showing the next overlay.


== Flags ==
==Keyvalues==
* 1 : Allow Suit Zoom
{{KV Targetname}}
{{KV|Overlay Name 1|intn=OverlayName1|to=Overlay Name 10|intn2=OverlayName10|string|Name of the first overlay material to display.}}
{{KV|Overlay Duration 1|intn=OverlayTime1)|to=Overlay Duration 10|intn2=OverlayTime10|float|Amount of time that the overlay should be displayed for, after which it will begin showing the next overlay. Setting this to -1 will make the entity display the overlay indefinitely, until it's forced to change by an input.}}


== Inputs ==
==Inputs==
* {{I Targetname}}
{{I|StartOverlays|Start displaying currently selected overlay, selected using the '''SwitchOverlay''' input.}}
* '''StartOverlays'''
{{I|StopOverlays|Stop displaying any overlays.}}
: Start displaying the first overlay.
{{I|SwitchOverlay|param=int|Switch to displaying a specific overlay. Pass in the desired overlay number in the parameter, where 1 is the first overlay, etc. Out of bounds values will be ignored. Negative numbers will be converted to positive numbers + 1 (-1 becomes 2, etc) due to how the input is coded internally.  
* '''StopOverlays'''
}}
: Stop displaying any overlays.
* '''SwitchOverlay <integer>'''
: Switch to displaying a specific overlay. Pass in the desired overlay number in the parameter. Entering -1 as the value will cause the overlay to display indefinitely.


== Outputs ==
==See also==
* {{O Targetname}}
*[http://www.youtube.com/watch?v=LVjaFo6esWw Video] with some overlays.


== See also ==
[[Category:GUI Entities]]
* [[Overlays]] - A large list of overlays.
[[Category:Special effects]]

Latest revision as of 04:29, 29 April 2025

English (en)中文 (zh)Translate (Translate)
An env_screenoverlay with effects/combine_binocoverlay on d2_coast_03.
C++ Class hierarchy
CEnvScreenOverlay
CPointEntity
CBaseEntity
C++ env_screenoverlay.cpp

env_screenoverlay is a logical entity available in all Source Source games. It can display and control a set of screen overlays, to be displayed over the player's view. Useful for view effects like drunkenness, or teleporter afterimages, etc.

Note.pngNote:An overlay will be applied to all players in multiplayer games, even when the!activatoris one player. To apply an overlay to a single client, the command r_screenoverlay <material_path> needs to be used with a point_clientcommand.
Note.pngNote:In Portal 2, screen overlays are disabled by default. You must set r_drawscreenoverlay 1 to enable.
Note.pngNote:In Team Fortress 2, the overlay can be overridden by certain actions such as being ubercharged or burned. The SetScriptOverlayMaterial input or VScript function on the player can be used to set a separate overlay that will not be overriden by such actions.

Materials

You can use any material as an overlay, but UnlitGeneric materials are the least likely to have any visual bugs.

Tip.pngTip:You can create custom pixel shaders for the overlay and pack them with the map. See sdk_screenspace_shaders for more details.

Valve provides these materials in the /effects folder:

combine_binocoverlay
Combine binoculars
tp_eyefx/tpeye
Green teleport shimmer
tp_eyefx/tpeye2
Red teleport shimmer
tp_eyefx/tpeye3
Blue teleport shimmer
tp_eyefx/tp_eyefx
Warped distortion, somewhat similar the one seen on strider charge shots.
tp_eyefx/tp_black
Black. A thin border around the overlay is still visible.
tp_eyefx/tp_eyefx_eli
Flashing animation of three figures. Hardly usable as an overlay.

These materials are not designed as screen overlays, but will work as one:

debug/yuv
Monochrome (Black and white)
effects/com_shield002a.vmt
The combine shield shader effect - refraction with drifting squares.
models/effects/portalfunnel_sheet
Red-yellow-green scrolling ground overlay
models/props_combine/portalball001_sheet
Green downward haze
effects/tp_refract
Red/Orange Refractive overlay
glass/glasswindow_refract01
As if looking through a glass Observation window from Portal

Flags

Allow Suit Zoom : [1] !FGD

Keyvalues

Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Overlay Name 1 (OverlayName1) to Overlay Name 10 (OverlayName10) <string>
Name of the first overlay material to display.
Overlay Duration 1 (OverlayTime1)) to Overlay Duration 10 (OverlayTime10) <float>
Amount of time that the overlay should be displayed for, after which it will begin showing the next overlay. Setting this to -1 will make the entity display the overlay indefinitely, until it's forced to change by an input.

Inputs

StartOverlays
Start displaying currently selected overlay, selected using the SwitchOverlay input.
StopOverlays
Stop displaying any overlays.
SwitchOverlay <integerRedirectInput/integer>
Switch to displaying a specific overlay. Pass in the desired overlay number in the parameter, where 1 is the first overlay, etc. Out of bounds values will be ignored. Negative numbers will be converted to positive numbers + 1 (-1 becomes 2, etc) due to how the input is coded internally.

See also

  • Video with some overlays.