The component represents a [https://docs.unity3d.com/ScriptReference/Camera.html Unity Camera] which is centered on the slot and facing in the forward (+z) [[direction]]. The produced image can either be accesed through a [[Component:RenderTextureProvider|RenderTextureProvider]] component or by creating a [[Texture2D]] asset using the [[ProtoFlux:Render To Texture Asset|Render To Texture Asset]] Protoflux node.
<languages></languages>
<translate>
<!--T:1-->
{{stub}}
{{Infobox Component
{{Infobox Component
|Image=CameraComponent.png
|Image=CameraComponent.png
Line 10:
Line 4:
}}
}}
<!--T:2-->
The '''Camera''' component represents a [https://docs.unity3d.com/ScriptReference/Camera.html Unity Camera] which is centered on the slot and facing in the [[Coordinate spaces#Directions|forward direction]].
== Fields ==
== Fields ==
{{Table ComponentFields
{{Table ComponentFields
|DoubleBuffered|Bool|Determines if [https://en.wikipedia.org/wiki/Multiple_buffering#Double_buffering_in_computer_graphics DoubleBuffering] is applied or not.
|DoubleBuffered|Bool|Determines if [https://en.wikipedia.org/wiki/Multiple_buffering#Double_buffering_in_computer_graphics DoubleBuffering] is applied or not.
Line 17:
Line 13:
|Projection|CameraProjection|Determines whether it's [https://en.wikipedia.org/wiki/Perspective_(graphical) perspective] or [https://en.wikipedia.org/wiki/Orthographic_projection orthographic]
|Projection|CameraProjection|Determines whether it's [https://en.wikipedia.org/wiki/Perspective_(graphical) perspective] or [https://en.wikipedia.org/wiki/Orthographic_projection orthographic]
|OrthographicSize|Float|The size of the render-output in orthographic view. (Only active when <code>Projection</code> is set to <code>Orthographic</code>
|OrthographicSize|Float|The size of the render-output in orthographic view. (Only active when <code>Projection</code> is set to <code>Orthographic</code>
|FieldOfView|Float|The size of the render-output in perspective view. (Only active when <code>Projection</code> is set to <code>Perspective</code>
|FieldOfView|Float|The vertical field of view of the camera. (Only active when <code>Projection</code> is set to <code>Perspective</code>
|NearClipping|Float|The point in units where the camera ignores near objects.
|NearClipping|Float|The point in meters where the camera ignores near objects.
|FarClipping|Float|The point in units where the camera ignores far objects.
|FarClipping|Float|The point in meters where the camera ignores far objects.
|UseTransformScale|Bool|Determines if the scale of the camera should be taken into account.
|UseTransformScale|Bool|Determines if the scale of the camera should be taken into account.
|Clear|CameraClearMode|
|Clear|CameraClearMode| See [[Type:CameraClearMode|Camera Clear Mode]] for what this does.
|ClearColor|Color|If <code>CameraClearMode</code> is set to <code>Color</code>.
|ClearColor|ColorX|If <code>CameraClearMode</code> is set to <code>Color</code>.
|Viewport|Rect|2D rectangular where the camera is allowed to render
|Viewport|Rect|2D rectangular where the camera is allowed to render
|Depth|Float|
|Depth|Float| Whether this camera should be rendered before or after other cameras render.
|RenderTexture|IAssetProvider`1|TypeString12=IAssetProvider<RenderTexture>|The RenderTextureProvider input in order to get a ITexture2D
|RenderTexture|{{RootFieldType|AssetRef`1|[[Type:RenderTexture|RenderTexture]]}}|TypeAdv12=true|The RenderTextureProvider input in order to get a ITexture2D
|Postprocessing|Bool|Determines if post processing is allowed.
|Postprocessing|Bool|Determines if post processing is allowed.
|ScreenSpaceReflections|Bool|Determines if [https://en.wikipedia.org/wiki/Reflection_(computer_graphics)#Approaches_to_reflection_rendering ScreenSpaceReflections] are rendered.
|ScreenSpaceReflections|Bool|Determines if [https://en.wikipedia.org/wiki/Reflection_(computer_graphics)#Approaches_to_reflection_rendering ScreenSpaceReflections] are rendered.
|MotionBlur|Bool|Determines if MotionBlur is rendered or not.
|MotionBlur|Bool|Determines if MotionBlur is rendered or not.
|RenderShadows|Bool|Determines if shadows are rendered or not.
|RenderShadows|Bool|Determines if shadows are rendered or not.
|SelectiveRender|SyncRefList`1|TypeString17=SyncRefList<Slot>|A list of SyncReferences to slots the camera is allowed to render.
|SelectiveRender|{{RootFieldType|AutoSyncRefList`1|[[Type:Slot|Slot]]}}|TypeAdv17=true|A list of SyncReferences to slots the camera is allowed to render.
|ExcludeRender|SyncRefList`1|TypeString18=SyncRefList<Slot>|A list of SyncReferences to slots the camera is NOT allowed to render.
|ExcludeRender|{{RootFieldType|AutoSyncRefList`1|[[Type:Slot|Slot]]}}|TypeAdv18=true|A list of SyncReferences to slots the camera is NOT allowed to render.
}}
}}
<!--T:3-->
== Usage ==
== Usage ==
<!--T:4-->
Put the component onto a slot, and position the slot. The produced image can either be accesed through a [[Component:RenderTextureProvider|RenderTextureProvider]] component or by creating a [[Texture2D]] asset using the [[ProtoFlux:Render To Texture Asset|Render To Texture Asset]] Protoflux node.
{{Note|If a camera is connected to a [[Component:RenderTextureProvider|RenderTextureProvider]], it will flash its contents to the screen whenever any field of the RenderTextureProvider is changed. To work around this, be sure to set the <code>Depth</code> value on the Camera component to something below <code>0</code> if you plan to change any fields while it is active. See [https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/964#issuecomment-2877264413 this comment on issue #964 for more information.]|warning}}
== Examples ==
== Examples ==
<!--T:5-->
Security cameras, drones, picture takers, layered texture bakers, scanners, and more.
== Related Components ==
</translate>
== See also ==
[[Category:ComponentStubs]]
* [[Component:CameraPortal]], which is often used as a mirror.
A list of SyncReferences to slots the camera is NOT allowed to render.
Usage
Put the component onto a slot, and position the slot. The produced image can either be accesed through a RenderTextureProvider component or by creating a Texture2D asset using the Render To Texture Asset Protoflux node.
If a camera is connected to a RenderTextureProvider, it will flash its contents to the screen whenever any field of the RenderTextureProvider is changed. To work around this, be sure to set the Depth value on the Camera component to something below 0 if you plan to change any fields while it is active. See this comment on issue #964 for more information.
Examples
Security cameras, drones, picture takers, layered texture bakers, scanners, and more.