docs.unity3d.com
    Show / Hide Table of Contents

    Main Camera

    Menu Path : Operator > BuiltIn > Main Camera

    The Main Camera Operator returns available information from the current main camera. It uses an equivalent behavior to Camera.main and an integration into the active Scriptable Render Pipeline for depth buffer and color buffer access.

    Operator properties

    Output Type Description
    o Camera Information about the main camera.

    Remarks

    If the main camera is unavailable, which can occur if:

    • If there is no camera GameObject tagged as MainCamera within the scene.
    • You manually trigger Simulate
    • It is during the prewarm update of the Visual Effect component.

    If this is the case, the Camera this Operator returns has the following default values:

    Property Default value
    Transform Transform identity : position zero, scale one, no rotation.
    fieldOfView 60.0
    nearPlane 0.3
    farPlane 1000
    aspectRatio 1.0
    pixelDimension (1920, 1080)
    depthBuffer Default texture2D array (gray texture)
    colorBuffer Default texture2D array (gray texture)

    The depthBuffer and colorBuffer textures are only available in a Scriptable Render Pipeline that implements VFXManager.SetCameraBuffer. HDRP officially supports this integration.

    In This Article
    • Operator properties
    • Remarks
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023