Env screenoverlay: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Removed lots of redundant information)
(updates)
Line 1: Line 1:
[[File:env_screenoverlay.jpg|thumb|320px|right|env_screenoverlay in practice with effects/combine_binocoverlay. The following links to a youtube video of these [http://www.youtube.com/watch?v=LVjaFo6esWw in effect]]]
{{lang|Env screenoverlay}}
[[File:env_screenoverlay.jpg|thumb|320px|right|An <code>env_screenoverlay</code> with <code>effects/combine_binocoverlay</code> on {{ent|d2_coast_03}}.]]
{{base point|env_screenoverlay}} 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.


{{base point|env_screenoverlay}} 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> (requires {{ent|sv_cheats|1}}, except for {{csgo}}) needs to be used with a {{ent|point_clientcommand}}.
{{note|An overlay will be applied to all players in multiplayer games, even when the !activator is a player. To apply an overlay to a single client, the command r_screenoverlay <material_path> (requires [[sv_cheats]]) needs to be used with a [[point_clientcommand]]. }}
}}
{{note|In {{csgo}}, when hosting on a dedicated server, [[point_clientcommand]] can be used to set r_screenoverlay on individual players with sv_cheats 0.}}
{{note|In {{portal2}}, screen overlays are disabled by default. You must set cvar <code>r_drawscreenoverlay</code> to <code>1</code> to enable.}}


== Materials ==
{{note|In {{portal2}}, screen overlays are disabled by default. You must set <code>r_drawscreenoverlay 1</code> to enable.}}
You can use any material as an overlay, but <code>[[UnlitGeneric]]</code> ones are recommended to avoid artefacting.


Valve provide these materials in the <code>/effects</code> folder:
{{code class|CEnvScreenOverlay|env_screenoverlay.cpp}}


==Materials==
You can use any material as an overlay, but {{ent|UnlitGeneric}} materials are the least likely to have any visual bugs.
Valve provides these materials in the <code>/effects</code> folder:
;combine_binocoverlay
;combine_binocoverlay
:Combine binoculars
:Combine binoculars
Line 20: Line 23:
: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 41: Line 44:
:As if looking through a glass Observation window from Portal
:As if looking through a glass Observation window from Portal


== Keyvalues ==
==Flags==
{{KV|Overlay Name 1|to=Overlay Name 10|string|Name of the first overlay material to display.}}
*1: Allow Suit Zoom
{{KV|Overlay Duration 1|to=Overlay Duration 10|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.}}
{{KV Targetname}}


== Flags ==
==Keyvalues==
* 1 : Allow Suit Zoom
{{KV|Overlay Name 1 (OverlayName1)|to=Overlay Name 10 (OverlayName10)|string|Name of the first overlay material to display.}}
{{KV|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.}}
{{KV BaseEntity|css=1}}


== Inputs ==
==Inputs==
{{IO|StartOverlays|Start displaying the first overlay.}}
{{IO|StartOverlays|Start displaying the first overlay.}}
{{IO|StopOverlays|Stop displaying any overlays.}}
{{IO|StopOverlays|Stop displaying any overlays.}}
{{IO|SwitchOverlay|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.|param=float}}
{{IO|SwitchOverlay|param=int|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.}}
{{I Targetname}}
{{I BaseEntity}}


== Outputs ==
==Outputs==
{{O Targetname}}
{{O BaseEntity|l4d=1}}


== See also ==
==See Also==
* [[Overlays]] - A large list of overlays.
*[http://www.youtube.com/watch?v=LVjaFo6esWw Video] with some overlays.


[[Category:GUI Entities]]
[[Category:GUI Entities]]
[[Category:Special effects]]
[[Category:Special effects]]

Revision as of 16:25, 30 September 2018

English (en)中文 (zh)Translate (Translate)
An env_screenoverlay with effects/combine_binocoverlay on d2_coast_03.

Template:Base point 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 !activator is one player. To apply an overlay to a single client, the command r_screenoverlay <material_path> (requires sv_cheats 1, except for Counter-Strike: Global Offensive) 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.
C++ In code, it is represented by theCEnvScreenOverlayclass, defined in theenv_screenoverlay.cppfile.

Materials

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

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

  • 1: Allow Suit Zoom

Keyvalues

Overlay Name 1 (OverlayName1) ([todo internal name (i)]) to Overlay Name 10 (OverlayName10) <string>
Name of the first overlay material to display.
Overlay Duration 1 (OverlayTime1) ([todo internal name (i)]) 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 the first overlay.
StopOverlays
Stop displaying any overlays.
SwitchOverlay <integerRedirectInput/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

  • Video with some overlays.