Skip to content

OutputCamera

Thomas Iché edited this page Oct 28, 2022 · 4 revisions

Output Camera Blocks & Operators

In VFX Graph, the Camera Type refers to only one camera in the game. However, in some cases, such as split-screen, we want to refer to the camera as "The currently rendering camera". Output Camera feature provides blocks and operators that are only compatible with output contexts, and that enable getting values from the currently rendering camera.

Output Camera (Operator)

The output Camera Operator gets values from the Currently rendering Camera. It is only working when connected to an Output Context.

image

  • Position the world-space position of the camera
  • Forward the world-space direction (forward vector) of the camera
  • Up the world-space up vector of the camera
  • Right the worls-space right vector of the camera
  • Resolution the current rendering resolution of the camera (in pixels)
  • NearFarPlane the near and far plane distances of the camera, encoded in X and Y components
  • FieldOfView the field of View of the camera projection, in radians
  • Ratio the rendering ratio (width/height) of the camera

Output Camera Position to View (Operator)

The output Camera Position to view operator outputs in Camera space an input position based on a Mode, at the near plane distance + offset. See below for camera modes.

image

  • Position the input position to transform
  • Position Mode the position mode for use as referential in camera space
  • Near Plane Offset an offset to the near plane for the particles

Transform Position to Output Camera (Block)

The Transform Position to Output Camera transforms particle positions to camera space based on a Mode, at the near plane distance + offset. See below for camera modes.

image

  • Position Mode the position mode for use as referential in camera space
  • Near Plane Offset an offset to the near plane for the particles

Position Modes

There are four camera Modes available in the Transform Position to Output Camera block and Output Camera Position to View operator dropdown.

In all modes the positions are set in an orthogonal referential as follows:

  • X : Camera Right Axis
  • Y : Camera Up Axis
  • Z : Camera Forward Axis

The modes control how X and Y axis scales depending on the screen ratio.

1 - Normalize to Viewport

The Normalize to Viewport mode scales the axis as follows:

  • X Axis scales from Left (-1.0) to Right (1.0)
  • Y Axis scales from Bottom (-1.0) to Top (1.0)

sspos-normalize

2 - Ratio Correct (Width)

The Ratio Correct (Width) mode scales the axis as follows:

  • X Axis scales from Left (-1.0) to Right (1.0)
  • Y Axis scales accordingly to maintain correcgt aspect ratio in coordinates

sspos-ratiocorrect-width

3 - Ratio Correct (Height)

The Ratio Correct (Width) mode scales the axis as follows:

  • Y Axis scales from Bottom (-1.0) to Top (1.0)
  • X Axis scales accordingly to maintain correcgt aspect ratio in coordinates

sspos-ratiocorrect-height

4 - Ratio Correct (Auto)

The Ratio Correct (Auto) chooses automatically between Ratio Correct Width and Height based on screen ratio, so the longer axis (between witdth, and height) is chosen.

sspos-ratiocorrect-auto