Skip to main content

<pc-camera>

The <pc-camera> tag is used to define a camera component.

Usage

Attributes

AttributeTypeDefaultDescription
clear-colorColor"0.75 0.75 0.75 1"Background color as space-separated RGBA values, hex code, or named color
clear-color-bufferBoolean"true"Controls whether the camera clears the color buffer
clear-depth-bufferBoolean"true"Controls whether the camera clears the depth buffer
clear-stencil-bufferBoolean"true"Controls whether the camera clears the stencil buffer
cull-facesBoolean"true"Controls whether the camera culls faces
enabledBoolean"true"Enabled state of the component
far-clipNumber"1000"The far clipping plane distance
flip-facesBoolean"false"Controls whether the camera flips faces
fovNumber"45"Field of view in degrees
frustum-cullingBoolean"true"Controls whether the camera uses frustum culling
gammaEnum"srgb"Color space: "linear" | "srgb"
horizontal-fovFlag-Whether to use horizontal field of view instead of vertical
near-clipNumber"0.1"The near clipping plane distance
orthographicFlag-Whether to use orthographic projection instead of perspective
ortho-heightNumber"10"Height of the orthographic projection
priorityNumber"0"Rendering priority of the camera
rectVector4"0 0 1 1"Viewport rectangle as "X Y Width Height" values
scissor-rectVector4"0 0 1 1"Scissor rectangle as "X Y Width Height" values
tonemapEnum"none"Tone mapping: "none" | "aces" | "aces2" | "filmic" | "hejl" | "linear" | "neutral"

Example

<pc-entity>
<pc-camera clear-color="yellow"></pc-camera>
</pc-entity>

JavaScript Interface

You can programmatically create and manipulate <pc-camera> elements using the CameraComponentElement API.