Garry's Mod Wiki

ViewSetup

Description

Table structure used for render.GetViewSetup.

Parameters

origin [Vector]

The view's origin/position

angles [Angle]

The view's angles

aspect [number]

Width divided by height

x [number]

The x position of the viewport

y [number]

The y position of the viewport

width [number]

The width of the viewport

height [number]

The height of the viewport

fov [number]

The main view's FOV, adjusted for aspect ratio.

fov_unscaled [number]

The main view's FOV as the user setting.

fovviewmodel [number]

The viewmodel's FOV, adjusted for aspect ratio.

fovviewmodel_unscaled [number]

The viewmodel's FOV as the user setting.

ortho [table]

If the current view is orthogonal, a table with these keys:

  • left
  • right
  • top
  • bottom

Will not be present if view is not orthagonal.

znear [number]

The distance of the view's origin to the near clipping plane

zfar [number]

The distance of the view's origin to the far clipping plane

znearviewmodel [number]

The distance of the view's origin to the near clipping plane for the viewmodel

zfarviewmodel [number]

The distance of the view's origin to the far clipping plane for the viewmodel

bloomtone [boolean]

Whether default engine bloom and tonemapping are enabled at this instant for this view.

subrect [boolean]

Whether m_bRenderToSubrectOfLargerScreen if set for this view.

offcenter [table]

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.