Func monitor: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Robot: Automated text replacement (-\{\|\r +{| class=standard-table))
No edit summary
Line 1: Line 1:
{{wrongtitle|title=func_monitor}}
[[File:City17 trainstation.jpg|thumb|A broadcast from Dr. Breen.]]


== Entity desciption ==
{{hl2 brush|func_monitor}} It displays a real-time scene captured from a [[point_camera]] somewhere else in the world.


A monitor that renders the view from a given [[point_camera]] entity.  
For the entity to work, the surface(s) on which the camera view will be displayed must have a material with <code>[[$basetexture]] _rt_Camera</code>. Stock materials that fit the bill are <code>dev\dev_combinemonitor*</code> and <code>dev\dev_tvmonitor*</code>. It's a good idea to [[Hammer Face Edit Dialog#Justify|Fit the textures to the face(s)]] so that the camera view isn't cut off.
{{brushmodel}}


When a func_monitor is created, the surface in which the view from the [[point_camera]] will be displayed from must be assigned to a material that uses the special value "_rt_Camera" in its "$basetexture" property (such as the dev/dev_combinemonitor* and dev/dev_tvmonitor* textures). It is also a good idea to Justify to Fit in the Face Edit Sheet texture dialog for the combinemonitor surface so the camera view isn't cut off.
Unless you set up multiple render textures in your mod's binaries, ''only one'' point_camera can be rendered at any one time. The first camera in the map will appear in all monitors.


Any number of func_monitor entities can only display ''one'' point_camera view at any one time (unless you reprogram this entity in some way). So, if monitor A is set to show camera A, and monitor B is set to show camera B, both monitors would show camera A, unless either monitor A or camera A were disabled in-game. You can use [[info_camera_link]] as a workaround.
{{tip|To enable monitors in your mod, you must <code>#define USE_MONITORS</code> as well as including the entity's CPP and H files. You can do this globally for the client project, or at the top of <code>client\viewrender.cpp</code> and <code>client\view.cpp</code>.}}


== Keyvalues ==
== See also ==
* {{KV Targetname}}
* {{KV Parentname}}
* {{KV Origin}}
* {{KV RenderFields}}
* {{KV Global}}
* {{KV EnableDisable}}
* {{KV Shadow}}
* '''_minlight'''
: <float> The minimum level of ambient light that hits this brush.
* '''Solidity'''
: <choices> Used to control the solidity/collision of these brushes.
:{| class=standard-table
! Literal Value || Description
|-
| 0 || Toggle
|-
| 1 || Never Solid
|-
| 2 || Always Solid
|}
* '''solidbsp'''
: {{boolean}} Set this if this brush is in hierarchy with a moving object of some kind, and the player can stand on this brush.
* '''excludednpc'''
: <target_destination> If an NPC classname (i.e. [[npc_zombie]]) is specified here, NPCs of that type won't collide with these brushes.
*'''target'''
:<target_destination> The [[point_camera]] in which the viewpoint is rendered from.


== Inputs ==
* [[info_camera_link]] (for rendering point_cameras on [[model]]s.
* {{I Targetname}}
* [[point_camera]]
* {{I RenderFields}}
* [[Render texture]]
* {{I Parentname}}
* {{I EnableDisable}}


*'''DisableShadow'''
== Keyvalues ==
:Turn shadow off.


*'''EnableShadow'''
; Camera name <[[targetname]]>
:Turn shadow on.
: The camera to render.
{{KV func_brush}}


*'''Toggle'''
== Inputs ==
:Toggle on/off.


*'''SetCamera <target_destination>'''
; <code>SetCamera <[[targetname]]></code>
:Sets the camera to use for this monitor. Takes the name of a [[point_camera]] entity in the map.
: The [[point_camera]] to render.
; <code>toggle</code>
; <code>enable</code>
; <code>disable</code>
: Control state of the camera output.
{{I func_brush}}


== Outputs ==
== Outputs ==
* {{O Targetname}}


== See also ==
{{O Targetname}}
* [[info_camera_link]]
* [[point_camera]]


[[Category:Entities]]
[[Category:Brush Entities]]
[[Category:Camera]]
[[Category:Camera]]

Revision as of 17:11, 25 January 2010

A broadcast from Dr. Breen.

Template:Hl2 brush It displays a real-time scene captured from a point_camera somewhere else in the world.

For the entity to work, the surface(s) on which the camera view will be displayed must have a material with $basetexture _rt_Camera. Stock materials that fit the bill are dev\dev_combinemonitor* and dev\dev_tvmonitor*. It's a good idea to Fit the textures to the face(s) so that the camera view isn't cut off.

Unless you set up multiple render textures in your mod's binaries, only one point_camera can be rendered at any one time. The first camera in the map will appear in all monitors.

Tip.pngTip:To enable monitors in your mod, you must #define USE_MONITORS as well as including the entity's CPP and H files. You can do this globally for the client project, or at the top of client\viewrender.cpp and client\view.cpp.

See also

Keyvalues

Camera name <targetname>
The camera to render.
func_brush:
Minimum Light Level (_minlight) <float>
The minimum level of ambient light that hits this brush.
Solidity (Solidity) <choices>
Used to control the solidity/collision of these brushes.
  • 0: Toggle - The solidity can be toggled together with its visibility.
  • 1: Never Solid
  • 2: Always Solid
Solid BSP (solidbsp) <boolean>
Set this if this brush is in hierarchy with a moving object of some kind, and the player can stand on this brush.
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.
Shadows (vrad_brush_cast_shadows) <boolean>
Configures whether this brush casts lightmap shadows.
Start Disabled (StartDisabled) <boolean>
Stay dormant until activated (with theEnableinput).
Tip.pngTip:If Solidity is Toggle, disabling func_brush also makes it non-solid.

Origin:

Origin (X Y Z) (origin) <origin>
The position of this entity's center in the world. Rotating entities typically rotate around their origin.

Shadow:

Disable Shadows (disableshadows) <boolean>
Prevents the entity from creating cheap render-to-texture shadows, or lightmap shadows if the entity is a prop_static. Does not affect shadow mapping.
Disable Receiving Shadows (disablereceiveshadows) <boolean>
Prevent the entity from receiving dynamic shadows on itself.
Shadow Cast Distance (shadowcastdist) <integer> !FGD
Sets how far the entity casts dynamic shadows. 0 means default distance from the shadow_control entity.
Disable Shadow Depth (disableshadowdepth) <boolean> (in all games since Portal 2)
Used to disable rendering into shadow depth (for projected textures) for this entity.
Disable flashlight (disableflashlight) <boolean> (in all games since Portal 2)
Used to disable projected texture lighting and shadows on this entity.
Projected Texture Cache (shadowdepthnocache) <integer choices> (in all games since Portal 2)
Used to hint projected texture system whether it is sufficient to cache shadow volume of this entity or to force render it every frame instead.
Choices
  • 0 : Default
  • 1 : No cache - render every frame
  • 2 : Cache it - render only once
Parentname:
Parent (parentname) <targetname>
Specifies a movement parent. An entity will maintain its initial offset from its parent. An attachment point can be added to the end of the name, separated by a comma.

RenderFields:


Render Mode (rendermode) <byte choices>
Set a non-standard rendering mode on this entity.
Render Modes
  • 0: Normal
  • 1: Color
  • 2: Texture
  • 3: Glow
  • 4: Solid/Alphatest Obsolete
  • 5: Additive
  • 6: Removed, does nothing Obsolete
  • 7: Additive Fractional Frame
  • 8: Alpha Add
  • 9: World Space Glow
  • 10: Don't Render
Render FX (renderfx) <byte choices>
Various somewhat legacy alpha effects. See render effects.
Render Amount / Transparency (renderamt) <byte>
Transparency amount, requires a Render Mode other than Normal. 0 is invisible, 255 is fully visible.
Render Color (R G B) (rendercolor) <color255>
Color tint.
Global:
Global Entity Name (globalname) <string>
Name by which this entity is linked to another entity in a different map. When the player transitions to a new map, entities in the new map with globalnames matching entities in the previous map will have the previous map's state copied over their state.
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

Inputs

SetCamera <targetname>
The point_camera to render.
toggle
enable
disable
Control state of the camera output.

Template:I func brush

Outputs