Lens Studio v1.0.0+
Inherits from Component
Renders the scene to an output texture. A Camera will only render a SceneObject if the SceneObject’s render layer is enabled on the Camera. For more information, see the Camera and Layers guide.
addRenderLayer(Number id) :
id to the list of layers the Camera will render.
checkRenderLayer(Number id) :
Returns whether rendering layer
id is enabled for the Camera.
Returns a list of 32 numbers, one for every render layer. Values will either be 0 or 1, 0 meaning the Camera won’t render the layer and 1 meaning it will.
For orthographic cameras, returns the camera size as (width, height).
Converts a world space position to a raw screen space position. The screen space position will be returned as a
y representing normalized screen space, and
z representing a raw depth value not directly convertible to world units. This returned value will mostly be useful for passing into
removeRenderLayer(Number id) :
id from the list of layers the Camera will render.
Converts a screen space position to a world space position, given an absolute depth. The screen space position should be provided as a
vec2 in the range ([0-1], [0-1]), (0,0) being the top-left of the screen and (1,1) being the bottom-right. The returned world space position will be the point
absoluteDepth units away from the Camera’s
near plane at the point specified in screen space.
Converts a raw screen space position to a world space position.
clipSpacePoint should be a
vec3 returned from a previous
project() call, since the
z value represents a raw depth value not directly convertible to world units.
Converts the world space position
worldSpacePoint to a screen space position. Screen positions are represented in the range ([0-1], [0-1]), (0,0) being the top-left of the screen and (1,1) being the bottom-right.
The aspect ratio of the camera (width/height).
The distance of the far clipping plane.
The Camera’s field of view in degrees.
If true, the camera FOV will be overridden to match the device’s physical camera FOV.
A texture controlling which parts of the output texture the camera will draw to. The “red” value of each pixel determines how strongly the camera will draw to that part of the image. For example, a completely black section will cause the camera to not draw there at all. A completely white (or red) section will cause the camera to draw normally. Colors in between, like gray, will be semitransparent.
The distance of the near clipping plane.
The sorting order the Camera renders in. Every frame, Cameras render in ascending order determined by their
The orthographic size of the camera.
Destroys the component.
Returns the SceneObject the component is attached to.
Returns the Transform this component is attached to.
Returns the name of this object’s type.
If disabled, the Component will stop enacting its behavior.
// Stops the camera from rendering the layer of dontRenderTarget //@input Component.Camera camera //@input SceneObject dontRenderTarget var layer = script.dontRenderTarget.getRenderLayer(); script.camera.removeRenderLayer(layer);
Still Looking for help?Visit Support