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.

Parameters

Vector origin
The view's original position
Angle angles
The view's angles
number aspect
Default width divided by height. Has a deprecated alias aspectratio.
number x
The x position of the viewport to render in
number y
The y position of the viewport to render in
number w
The width of the viewport to render in
number h
The height of the viewport to render in
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

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

  • left
  • right
  • top
  • bottom
number ortholeft
Coordinate for the left clipping plane. Requires ortho to be set to true.

Deprecated: Use ortho table instead!

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

Deprecated: Use ortho table instead!

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

Deprecated: Use ortho table instead!

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

Deprecated: Use ortho table instead!

number znear
The distance of the view's origin to the near clipping plane
number zfar
The distance of the view's origin to the far clipping plane
number znearviewmodel
The distance of the view's origin to the near clipping plane for the viewmodel
number zfarviewmodel
The distance of the view's origin to the far clipping plane for the viewmodel
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

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.