Garry's Mod Wiki

ViewData

Description

Table structure used for render.RenderView.

Unless stated otherwise, the default values for all these keys would be inherited from the engine's CViewSetup and do not have static representations.

Members

Vector origin
The view's original position. Defaults to the current view's origin
Angle angles
The view's angles. Defaults to the current view's angles
number aspect
Defaults to width divided by height. Has a deprecated alias aspectratio.
number aspectratio
The deprecated alias of aspect. Defaults to width divided by height.

Deprecated: Use aspect instead!

number x
The x position of the viewport to render in

Default: 0

number y
The y position of the viewport to render in

Default: 0

number w
The width of the viewport to render in. Defaults to the current viewport's width
number h
The height of the viewport to render in. Defaults to the current viewport's height
boolean drawhud
Draw the HUD and call the hud painting related hooks

Default: false

boolean drawmonitors
Draw monitors

Default: false

boolean drawviewmodel
The weapon's viewmodel

Default: true

boolean drawviewer
Whether to force draw the local player or not.

Default: false

number viewmodelfov
The viewmodel's FOV. Defaults to the current viewmodel FOV
number fov
The main view's FOV. Defaults to the current view's FOV
table ortho
If set, renders the view orthogonally. A table with these keys:

  • left
  • right
  • top
  • bottom

Default: nil

number ortholeft
Coordinate for the left clipping plane. Requires ortho to be set to true.

Deprecated: Use ortho table instead!

Default: nil

number orthoright
Coordinate for the right clipping plane. Requires ortho to be set to true.

Deprecated: Use ortho table instead!

Default: nil

number orthotop
Coordinate for the top clipping plane. Requires ortho to be set to true.

Deprecated: Use ortho table instead!

Default: nil

number orthobottom
Coordinate for the bottom clipping plane. Requires ortho to be set to true.

Deprecated: Use ortho table instead!

Default: nil

number znear
The distance of the view's origin to the near clipping plane. Defaults to the current view's near clipping distance
number zfar
The distance of the view's origin to the far clipping plane. Defaults to the current view's far clipping distance
number znearviewmodel
The distance of the view's origin to the near clipping plane for the viewmodel. Defaults to the viewmodel's current near clipping distance
number zfarviewmodel
The distance of the view's origin to the far clipping plane for the viewmodel. Defaults to the viewmodel's current far clipping distance
boolean dopostprocess
Currently works identically to the "bloomtone" option (it also overrides it if you set this to false).

Default: false

boolean bloomtone
Disables default engine bloom and pauses the "brightness changes" on HDR maps.

Default: true

number with VIEW enum viewid
This is identifying which logical part of the scene an entity is being redered in, see VIEW enum.

Default: 0

table offcenter
This allows you to "zoom in" on a part of the screen - for example, the top-left quarter of the screen. This is similar to how poster splits the screen into separate renders.

It's a table with 4 keys, controlling what portion of the screen to draw:

  • left - where the left edge starts. Natural value is 0.
  • right - where the right edge ends. Natural value is equal to w (the width of the viewport).
  • top - where the bottom edge starts. Natural value is 0.
  • bottom - where the top edge ends. Natural value is equal to h (the height of the viewport).

Note that top and bottom are reversed.

Values outside the viewport are allowed, but not recommended - instead you should increase the view FOV.

Default: nil