Garry's Mod Wiki

ViewSetup

Description

Table structure used for render.GetViewSetup.

Parameters

Vector origin
The view's origin/position
Angle angles
The view's angles
number aspect
Width divided by height
number x
The x position of the viewport
number y
The y position of the viewport
number width
The width of the viewport
number height
The height of the viewport
number fov
The main view's FOV, adjusted for aspect ratio.
number fov_unscaled
The main view's FOV as the user setting.
number fovviewmodel
The viewmodel's FOV, adjusted for aspect ratio.
number fovviewmodel_unscaled
The viewmodel's FOV as the user setting.
table ortho
If the current view is orthogonal, a table with these keys:

  • left
  • right
  • top
  • bottom

Will not be present if view is not orthagonal.

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 bloomtone
Whether default engine bloom and tonemapping are enabled at this instant for this view.
boolean subrect
Whether m_bRenderToSubrectOfLargerScreen if set for this view.
table offcenter
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.

This will not be present if offscreen rendering is not enabled for this view.

See Structures/ViewData for more info.