Class Scene3D
Represents a 3D scene for rendering, including lighting and an optional skybox.
Inherited Members
Namespace: Genesis.Core
Assembly: Genesis.dll
Syntax
public class Scene3D : Scene
Constructors
Scene3D(string, DirectionalLight)
Initializes a new instance of the Scene3D class.
Declaration
public Scene3D(string name, DirectionalLight sun)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the scene. |
DirectionalLight | sun | The light source (sun) in the scene. |
Properties
ShadowResolution
Gets or sets the resolution of the shadow map.
Declaration
public Vec3 ShadowResolution { get; set; }
Property Value
Type | Description |
---|---|
Vec3 | A Vec3 representing the width, height, and depth (unused) of the shadow map in pixels. The default value is (1024, 1024, 0), where the third component is typically not used. |
Skybox
Gets or sets the skybox used in the scene (optional).
Declaration
public Skybox Skybox { get; set; }
Property Value
Type | Description |
---|---|
Skybox |
Sun
Gets or sets the light source (sun) in the scene.
Declaration
public DirectionalLight Sun { get; set; }
Property Value
Type | Description |
---|---|
DirectionalLight |
Methods
Init(Game, IRenderDevice)
Initializes the 3D scene.
Declaration
public override void Init(Game game, IRenderDevice renderDevice)
Parameters
Type | Name | Description |
---|---|---|
Game | game | The game instance. |
IRenderDevice | renderDevice | The render device used for rendering. |
Overrides
OnDestroy(Game)
Called when the scene is destroyed.
Declaration
public override void OnDestroy(Game game)
Parameters
Type | Name | Description |
---|---|---|
Game | game | The game instance. |
Overrides
OnRender(Game, IRenderDevice)
Called during the rendering phase of the game loop.
Declaration
public override void OnRender(Game game, IRenderDevice renderDevice)
Parameters
Type | Name | Description |
---|---|---|
Game | game | The game instance. |
IRenderDevice | renderDevice | The render device used for rendering. |
Overrides
OnUpdate(Game, IRenderDevice)
Called during the update phase of the game loop.
Declaration
public override void OnUpdate(Game game, IRenderDevice renderDevice)
Parameters
Type | Name | Description |
---|---|---|
Game | game | The game instance. |
IRenderDevice | renderDevice | The render device used for rendering. |
Overrides
RenderShadowMap(Light, Game, IRenderDevice)
Declaration
public void RenderShadowMap(Light light, Game game, IRenderDevice renderDevice)
Parameters
Type | Name | Description |
---|---|---|
Light | light | |
Game | game | |
IRenderDevice | renderDevice |