Class Sky
Sky actor renders atmosphere around the scene with fog and sky.
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/Level/Actors/Sky.h
Syntax
public class Sky : public Actor, public IAtmosphericFogRenderer, public ISkyRenderer
Constructors
~Sky()
Declaration
public ~Sky()
Fields
IndirectLightingIntensity
Controls how much sky will contribute indirect lighting. When set to 0, there is no GI from the sky. The default value is 1.
Declaration
public float IndirectLightingIntensity = 1.0f
Field Value
float
|
SunDiscScale
The sun disc scale.
Declaration
public float SunDiscScale = 2.0f
Field Value
float
|
SunLight
Directional light that is used to simulate the sun.
Declaration
public ScriptingObjectReference<DirectionalLight> SunLight
Field Value
ScriptingObjectReference<DirectionalLight>
|
SunPower
The sun power.
Declaration
public float SunPower = 8.0f
Field Value
float
|
Methods
ApplySky(GPUContext* context, RenderContext& renderContext, const Matrix& world)
Apply sky material/shader state to the GPU pipeline with custom parameters set (render to GBuffer).
Declaration
public virtual void ApplySky(GPUContext* context, RenderContext& renderContext, const Matrix& world) override
Parameters
GPUContext
context
The context responsible for rendering commands. |
RenderContext
renderContext
The rendering context. |
Matrix
world
The world matrix to use during sky model vertices transformations. |
Overrides
Deserialize(DeserializeStream& stream, ISerializeModifier* modifier)
Deserializes object from the input stream.
Declaration
public virtual void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override
Parameters
DeserializeStream
stream
The input stream. |
ISerializeModifier
modifier
The deserialization modifier object. Always valid. |
Overrides
Draw(RenderContext& renderContext)
Draws this actor. Called by Scene Rendering service. This call is more optimized than generic Draw (eg. geometry is rendered during all pass types but other actors are drawn only during GBufferFill pass).
Declaration
public virtual void Draw(RenderContext& renderContext) override
Parameters
RenderContext
renderContext
The rendering context. |
Overrides
DrawFog(GPUContext* context, RenderContext& renderContext, GPUTextureView* output)
Draw fog using GBuffer inputs
Declaration
public virtual void DrawFog(GPUContext* context, RenderContext& renderContext, GPUTextureView* output) override
Parameters
GPUContext
context
Context responsible for rendering commands |
RenderContext
renderContext
The rendering context. |
GPUTextureView
output
Output buffer |
Overrides
EndPlay()
Called when removing object from the game.
Declaration
protected virtual void EndPlay() override
Overrides
GetEditorBox()
Gets actor bounding box (single actor, no children included) for editor tools.
Declaration
public virtual BoundingBox GetEditorBox() const override
Returns
BoundingBox
|
Overrides
GetIndirectLightingIntensity()
Declaration
public virtual float GetIndirectLightingIntensity() const override
Returns
float
|
Overrides
HasContentLoaded()
Returns true if actor has loaded content.
Declaration
public virtual bool HasContentLoaded() const override
Returns
bool
|
Overrides
IntersectsItself(const Ray& ray, Real& distance, Vector3& normal)
Determines if there is an intersection between the current object and a ray.
Declaration
public virtual bool IntersectsItself(const Ray& ray, Real& distance, Vector3& normal) override
Parameters
Ray
ray
The ray to test. |
Real
distance
When the method completes, contains the distance of the intersection (if any valid). |
Vector3
normal
When the method completes, contains the intersection surface normal vector (if any valid). |
Returns
bool
True whether the two objects intersected, otherwise false. |
Overrides
IsDynamicSky()
Returns true if sky is realtime, otherwise it's static.
Declaration
public virtual bool IsDynamicSky() const override
Returns
bool
|
Overrides
OnDisable()
Called when actor gets removed from game systems. Occurs on EndPlay event or when actor gets inactivated in hierarchy. Use this event to unregister object from other game system (eg. audio).
Declaration
protected virtual void OnDisable() override
Overrides
OnEnable()
Called when actor gets added to game systems. Occurs on BeginPlay event or when actor gets activated in hierarchy. Use this event to register object to other game system (eg. audio).
Declaration
protected virtual void OnEnable() override
Overrides
OnTransformChanged()
Called when actor transform gets changed.
Declaration
protected virtual void OnTransformChanged() override
Overrides
Serialize(SerializeStream& stream, const void* otherObj)
Serializes object to the output stream compared to the values of the other object instance (eg. default class object). If other object is null then serialize all properties.
Declaration
public virtual void Serialize(SerializeStream& stream, const void* otherObj) override
Parameters
SerializeStream
stream
The output stream. |
void
otherObj
The instance of the object to compare with and serialize only the modified properties. If null, then serialize all properties. |