s&
newspaper
About
info
About s&box
newspaper
Latest News
published_with_changes
Changes
map
Roadmap
monitoring
Metrics
games
Games
sports_esports
Browse Games
rocket
Discover Games
business_center
Workshop
sports_esports
Games
landscape
Maps
chair
Models
texture
Materials
apparel
Clothing
construction
More..
forum
Forum
docs
Docs
docs
Documentation
dashboard
Api Reference
school
Tutorials
input
Log in with Steam
chevron_left
Change Language
简体中文
English
Русский
Español
Português-Brasil
Deutsch
日本語
Français
Polski
Türkçe
한국어
Pirate
Italiano
ไทย
繁體中文
Українська
Čeština
Nederlands
Magyar
Dansk
Suomi
Svenska
Norsk
Ελληνικά
Română
Български
Tiếng Việt
Bahasa Indonesia
Español-Latinoamérica
العربية
Api
Classes
SceneCamera
chevron_left
Classes
class
SceneCamera
search
Constructors
functions
SceneCamera
Properties
data_object
AmbientLightColor
data_object
Angles
data_object
AntiAliasing
data_object
Attributes
data_object
BackgroundColor
data_object
Bloom
data_object
ClearFlags
data_object
CubemapFog
data_object
CustomProjectionMatrix
data_object
DebugMode
data_object
EnableDirectLighting
data_object
EnableIndirectLighting
data_object
EnablePostProcessing
data_object
ExcludeTags
data_object
FieldOfView
data_object
Name
remove_circle
OnRenderOpaque
data_object
OnRenderOverlay
remove_circle
OnRenderPostProcess
remove_circle
OnRenderTransparent
data_object
OnRenderUI
data_object
Ortho
data_object
OrthoHeight
data_object
Position
data_object
Rect
data_object
RenderTags
data_object
Rotation
data_object
Size
data_object
TargetEye
data_object
VolumetricFog
data_object
WantsStereoSubmit
data_object
WireframeMode
data_object
World
data_object
Worlds
data_object
ZFar
data_object
ZNear
Methods
functions
Dispose
functions
GetFrustum
functions
GetRay
functions
ToScreen
functions
ToScreenNormal
functions
ToWorld
Static Methods
functions
RenderToPixmap
functions
RenderToVideo
functions
RenderToVideoAsync
SceneCamera
Represents a camera and holds render hooks. This camera can be used to draw tool windows and scene panels.
class
Sandbox
.
sealed
Sandbox.Engine
build
Constructors
1
SceneCamera
(
name
)
data_object
Properties
36
AmbientLightColor
Color
The color of the ambient light. Set it to black for no ambient light, alpha is used for lerping between IBL and constant color.
Angles
Angles
The rotation of the scene's camera.
AntiAliasing
bool
Enable or disable anti-aliasing for this render.
Attributes
RenderAttributes
BackgroundColor
Color
Color the scene camera clears the render target to.
Bloom
BloomAccessor
Access tonemapping properties of camera
ClearFlags
ClearFlags
What kind of clearing should we do before we begin?
CubemapFog
CubemapFogController
Control fog based on an image.
CustomProjectionMatrix
Nullable`1
Allows specifying a custom projection matrix for this camera
DebugMode
SceneCameraDebugMode
Render this camera using a different render mode
EnableDirectLighting
bool
Enable or disable direct lighting
EnableIndirectLighting
bool
Enable or disable indirect lighting
EnablePostProcessing
bool
Toggle all post processing effects for this camera. The default is on.
ExcludeTags
ITagSet
Scene objects with any of these tags won't be rendered by this camera.
FieldOfView
float
The horizontal field of view of the Camera in degrees.
Name
string
The name of this camera.. for debugging purposes.
OnRenderOpaque
obsolete
Action
Called when rendering the transparent pass
OnRenderOverlay
Action
OnRenderPostProcess
obsolete
Action
Called when rendering the post process pass
OnRenderTransparent
obsolete
Action
Called when rendering the transparent pass
OnRenderUI
Action
Ortho
bool
Whether to use orthographic projection.
OrthoHeight
float
Height of the ortho when Sandbox.SceneCamera.Ortho is enabled.
Position
Vector3
The position of the scene's camera.
Rect
Rect
The rect of the screen to render to. This is normalized, between 0 and 1.
RenderTags
ITagSet
Only scene objects with one of these tags will be rendered by this camera.
Rotation
Rotation
The rotation of the scene's camera.
Size
Vector2
The size of the screen. Allows us to work out aspect ratio. For now will get updated automatically on render.
TargetEye
StereoTargetEye
The HMD eye that this camera is targeting. Use Sandbox.StereoTargetEye.None for the user's monitor (i.e. the companion window).
VolumetricFog
VolumetricFogParameters
Control volumetric fog parameters, expect this to take 1-2ms of your GPU frame time.
WantsStereoSubmit
bool
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.
WireframeMode
bool
Render this camera using a wireframe view.
World
SceneWorld
The world we're going to render.
Worlds
HashSet`1
Your camera can render multiple worlds.
ZFar
float
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.
ZNear
float
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.
functions
Methods
6
Dispose
(
)
GetFrustum
(
pixelRect
)
Frustum
Given a pixel rect return a frustum on the current camera.
GetRay
(
cursorPosition
)
Ray
Given a cursor position get a scene aiming ray.
ToScreen
(
world
)
Vector2
Convert from world coords to screen coords. The results for x and y will be from 0 to Sandbox.SceneCamera.Size.
ToScreenNormal
(
world
)
Vector2
Convert from world coords to normal screen corrds. The results will be between 0 and 1
ToWorld
(
screen
)
Vector3
Convert from screen coords to world coords on the near frustum plane.
functions
Static Methods
3
RenderToPixmap
(
camera
,
targetPixmap
,
async
)
bool
Render this camera to the target widget. Once you do this the target widget becomes "externally painted", so you won't be able to paint on it anymore with Qt's Paint stuff.
RenderToVideo
(
camera
,
videoWriter
,
time
)
bool
RenderToVideoAsync
(
camera
,
videoWriter
,
time
)
Task`1
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.