s&box docs

public sealed class Sandbox.SceneCamera

Represents a camera and holds render hooks. This camera can be used to draw tool windows and scene panels.

Broader workflow and conceptual references connected to this API.

Constructors

Showing 1 constructors

public SceneCamera(string name = Unnamed)

Parameters

  • name: Default: Unnamed

Methods

Showing 9 methods

public virtual sealed void Dispose()

public Vector2 ToScreenNormal(Vector3 world)

Convert from world coords to normal screen corrds. The results will be between 0 and 1

public Vector3 ToWorld(Vector2 screen)

Convert from screen coords to world coords on the near frustum plane.

Properties

Showing 36 properties

public Color Sandbox.SceneCamera.AmbientLightColor { get; set; }

The color of the ambient light. Set it to black for no ambient light, alpha is used for lerping between IBL and constant color.

public bool Sandbox.SceneCamera.AntiAliasing { get; set; }

Enable or disable anti-aliasing for this render.

public Color Sandbox.SceneCamera.BackgroundColor { get; set; }

Color the scene camera clears the render target to.

public System.Nullable`1<Matrix> Sandbox.SceneCamera.CustomProjectionMatrix { get; set; }

Allows specifying a custom projection matrix for this camera

public bool Sandbox.SceneCamera.EnableDirectLighting { get; set; }

Enable or disable direct lighting

public bool Sandbox.SceneCamera.EnableIndirectLighting { get; set; }

Enable or disable indirect lighting

public bool Sandbox.SceneCamera.EnablePostProcessing { get; set; }

Toggle all post processing effects for this camera. The default is on.

public Sandbox.ITagSet Sandbox.SceneCamera.ExcludeTags { get; set; }

Scene objects with any of these tags won't be rendered by this camera.

public float Sandbox.SceneCamera.FieldOfView { get; set; }

The horizontal field of view of the Camera in degrees.

public string Sandbox.SceneCamera.Name { get; set; }

The name of this camera.. for debugging purposes.

public System.Action Sandbox.SceneCamera.OnRenderOpaque { get; set; }Obsolete

Called when rendering the transparent pass

Obsolete: This API member is obsolete.

public System.Action Sandbox.SceneCamera.OnRenderOverlay { get; set; }

public System.Action Sandbox.SceneCamera.OnRenderPostProcess { get; set; }Obsolete

Called when rendering the post process pass

Obsolete: This API member is obsolete.

public System.Action Sandbox.SceneCamera.OnRenderTransparent { get; set; }Obsolete

Called when rendering the transparent pass

Obsolete: This API member is obsolete.

public System.Action Sandbox.SceneCamera.OnRenderUI { get; set; }

public bool Sandbox.SceneCamera.Ortho { get; set; }

Whether to use orthographic projection.

public float Sandbox.SceneCamera.OrthoHeight { get; set; }

Height of the ortho when `Sandbox.SceneCamera.Ortho` is enabled.

public Sandbox.Rect Sandbox.SceneCamera.Rect { get; set; }

The rect of the screen to render to. This is normalized, between 0 and 1.

public Sandbox.ITagSet Sandbox.SceneCamera.RenderTags { get; set; }

Only scene objects with one of these tags will be rendered by this camera.

public Vector2 Sandbox.SceneCamera.Size { get; set; }

The size of the screen. Allows us to work out aspect ratio. For now will get updated automatically on render.

public Sandbox.StereoTargetEye Sandbox.SceneCamera.TargetEye { get; set; }

The HMD eye that this camera is targeting. Use `Sandbox.StereoTargetEye.None` for the user's monitor (i.e. the companion window).

public Sandbox.VolumetricFogParameters Sandbox.SceneCamera.VolumetricFog { get; set; }

Control volumetric fog parameters, expect this to take 1-2ms of your GPU frame time.

public bool Sandbox.SceneCamera.WantsStereoSubmit { get; set; }

Set this to false if you don't want the stereo renderer to submit this camera's texture to the compositor. This option isn't considered if `Sandbox.SceneCamera.TargetEye` is `Sandbox.StereoTargetEye.None`.

public bool Sandbox.SceneCamera.WireframeMode { get; set; }

Render this camera using a wireframe view.

public System.Collections.Generic.HashSet`1<Sandbox.SceneWorld> Sandbox.SceneCamera.Worlds { get; set; }

Your camera can render multiple worlds.

public float Sandbox.SceneCamera.ZFar { get; set; }

The camera's zFar distance. This is the furthest distance this camera will be able to render. This value totally depends on the game you're making. Shorter the better, sensible ranges would be between about 1000 and 30000, but if you want it to be further out you can balance that out by making znear larger.

public float Sandbox.SceneCamera.ZNear { get; set; }

The camera's zNear distance. This is the closest distance this camera will be able to render. A good value for this is about 5. Below 5 and particularly below 1 you're going to start to see a lot of artifacts like z-fighting.

Metadata

FieldValue
NamespaceSandbox
Typeclass
AssemblySandbox.Engine
Doc IDT:Sandbox.SceneCamera

On this page

Constructorspublic SceneCamera(System.String name = Unnamed)Methodspublic virtual sealed System.Void Dispose()public Sandbox.Frustum GetFrustum(Sandbox.Rect pixelRect, Vector3 screenSize)public Sandbox.Frustum GetFrustum(Sandbox.Rect pixelRect)public Ray GetRay(Vector2 cursorPosition, Vector3 screenSize)public Ray GetRay(Vector3 cursorPosition)public System.Boolean ToScreen(Vector3 world, Vector2 screen)public Vector2 ToScreen(Vector3 world)public Vector2 ToScreenNormal(Vector3 world)public Vector3 ToWorld(Vector2 screen)Propertiespublic Color Sandbox.SceneCamera.AmbientLightColor { get; set; }public Angles Sandbox.SceneCamera.Angles { get; set; }public System.Boolean Sandbox.SceneCamera.AntiAliasing { get; set; }public Sandbox.RenderAttributes Sandbox.SceneCamera.Attributes { get; set; }public Color Sandbox.SceneCamera.BackgroundColor { get; set; }public Sandbox.SceneCamera.BloomAccessor Sandbox.SceneCamera.Bloom { get; set; }public Sandbox.ClearFlags Sandbox.SceneCamera.ClearFlags { get; set; }public Sandbox.CubemapFogController Sandbox.SceneCamera.CubemapFog { get; set; }public System.Nullable`1<Matrix> Sandbox.SceneCamera.CustomProjectionMatrix { get; set; }public Sandbox.SceneCameraDebugMode Sandbox.SceneCamera.DebugMode { get; set; }public System.Boolean Sandbox.SceneCamera.EnableDirectLighting { get; set; }public System.Boolean Sandbox.SceneCamera.EnableIndirectLighting { get; set; }public System.Boolean Sandbox.SceneCamera.EnablePostProcessing { get; set; }public Sandbox.ITagSet Sandbox.SceneCamera.ExcludeTags { get; set; }public System.Single Sandbox.SceneCamera.FieldOfView { get; set; }public System.String Sandbox.SceneCamera.Name { get; set; }public System.Action Sandbox.SceneCamera.OnRenderOpaque { get; set; }public System.Action Sandbox.SceneCamera.OnRenderOverlay { get; set; }public System.Action Sandbox.SceneCamera.OnRenderPostProcess { get; set; }public System.Action Sandbox.SceneCamera.OnRenderTransparent { get; set; }public System.Action Sandbox.SceneCamera.OnRenderUI { get; set; }public System.Boolean Sandbox.SceneCamera.Ortho { get; set; }public System.Single Sandbox.SceneCamera.OrthoHeight { get; set; }public Vector3 Sandbox.SceneCamera.Position { get; set; }public Sandbox.Rect Sandbox.SceneCamera.Rect { get; set; }public Sandbox.ITagSet Sandbox.SceneCamera.RenderTags { get; set; }public Rotation Sandbox.SceneCamera.Rotation { get; set; }public Vector2 Sandbox.SceneCamera.Size { get; set; }public Sandbox.StereoTargetEye Sandbox.SceneCamera.TargetEye { get; set; }public Sandbox.VolumetricFogParameters Sandbox.SceneCamera.VolumetricFog { get; set; }public System.Boolean Sandbox.SceneCamera.WantsStereoSubmit { get; set; }public System.Boolean Sandbox.SceneCamera.WireframeMode { get; set; }public Sandbox.SceneWorld Sandbox.SceneCamera.World { get; set; }public System.Collections.Generic.HashSet`1<Sandbox.SceneWorld> Sandbox.SceneCamera.Worlds { get; set; }public System.Single Sandbox.SceneCamera.ZFar { get; set; }public System.Single Sandbox.SceneCamera.ZNear { get; set; }Metadata