GFX
  • Docs
  • API
Search Results for

    Show / Hide Table of Contents
    • Genesis.Core
      • AssetManager
      • DirectionalLight
      • Game
      • GameElement
      • GameEventHandler
      • IGameBehavior
      • Input
      • Input.Keys
      • Layer
      • Light
      • Light2D
      • PointLight
      • Scene
      • Scene2D
      • Scene3D
      • SceneEventHandler
      • SceneSizeEvenHandler
      • Storage
      • Utils
      • Window
      • Window.WindowEventHandler
      • WindowUtilities
      • WindowUtilities.POINT
      • WindowUtilities.RECT
    • Genesis.Core.Behaviors
      • AnimationBehavior
      • CameraFlags
      • CharacterController2D
      • ControllerPreset
      • MoveDirection
      • MovementFlags
      • SpriteMovementController
    • Genesis.Core.Behaviors.Physics2D
      • BoxCollider
      • BoxRigidBody
      • BoxTrigger2D
      • BufferedSpriteCollider
      • PhysicsBox2D
      • PhysicsPolygon2D
      • Rigidbody2D
    • Genesis.Core.Behaviors.Physics3D
      • BoxCollider
      • BoxRigidBody
      • BoxTrigger
      • CapsuleCollider
      • CapsuleRigidBody
      • CompoundMeshCollider
      • ConvexHullBehavior
      • ConvexHullCollider
      • MeshCollider
      • QubeConvexHull
      • SphereCollider
      • SphereRigidBody
      • SphereTrigger
      • StaticMeshBehavior
    • Genesis.Core.Behaviors._3D
      • Stance
      • ThirdpersonCharacterController
    • Genesis.Core.GameElements
      • BufferedSprite
      • CameraElement
      • Element3D
      • Empty
      • FindPathAsynchResult
      • GridCell
      • Model
      • NavMesh
      • Obstacle
      • ParticleBuffers
      • ParticleDeffinition
      • ParticleEmitter
      • Qube
      • RectElement
      • Skybox
      • Sphere
      • Sprite
      • SpriteShapeDeffinition
      • Terrain2D
      • Terrain3D
      • TerrainData
      • Waypoint
    • Genesis.Graphics
      • Animation
      • AnimationCallback
      • AnimationCallback.AnimationEvent
      • Camera
      • CameraType
      • Face
      • Font
      • Framebuffer
      • Frustum
      • Glyphe
      • IRenderDevice
      • InstancedElement
      • InstancedMesh
      • Material
      • MaterialBuffer
      • Mesh
      • PerspectiveCamera
      • RenderInstanceContainer
      • RenderSettings
      • Shader
      • ShaderProgram
      • SpriteSheet
      • TexCoords
      • Texture
      • Viewport
    • Genesis.Graphics.Animation3D
      • Animation
      • Animator
      • AssimpNodeData
      • Bone
      • KeyPosition
      • KeyRotation
      • KeyScale
      • ModelMesh
      • boneinfo
      • vertex
    • Genesis.Graphics.Physics
      • BulletDebugRenderer
    • Genesis.Graphics.RenderDevice
      • GLRenderer
      • LegacyRenerer
    • Genesis.Graphics.Shaders.OpenGL
      • AnimatedModelShader
      • BasicShader
      • BorderCircleShader
      • DiffuseLightning
      • DiffuseNormalLightning
      • DiffuseNormalShader
      • DiffuseShader
      • DiffuseSolidShader
      • Element3DShader
      • FXScreenSpaceShadowShader
      • InstanceShader2D
      • InstancedShader
      • Light2DShader
      • LightmapShader
      • MVPRectShader
      • MVPShader
      • MVPSolidShader
      • ParticleShader
      • ScreenShader
      • SkyboxShader
      • SolidShapeShader
      • SpecularShader
      • SpriteShader
      • TerrainShader
      • WireframeShader
    • Genesis.Graphics.Shapes
      • BufferedSpriteShape
      • CircleShape
      • FrameShape
      • GlypheShape
      • Light2DShape
      • LineShape
      • PlaneShape
      • QubeShape
      • RectShape
      • Shape
      • SphereShape
      • SpriteShape
    • Genesis.Math
      • Matrix4x4
      • NoisePoint
      • PerlinNoise
      • Rect
      • Vec3
    • Genesis.Physics
      • Aabb
      • ColliderBehavior2D
      • ColliderBehavior3D
      • CollisionGroup
      • CollisionGroupExtensions
      • HitResult
      • HitResult2D
      • MatrixSet
      • MouseRay2
      • PhysicHandler
      • PhysicHandlerEvent
      • PhysicPropeterys
      • PhysicsBehavior
      • PhysicsBehaviorEvent
      • PhysicsHandler2D
      • PhysicsHandler3D
      • Ray2D
      • Raycast
      • Raycast2D
      • RigidBodyBehavior2D
      • RigidBodyBehavior3D
      • TriggerBehavior2D
      • TriggerBehavior3D
    • Genesis.UI
      • Button
      • Canvas
      • GridView
      • ImageButton
      • Label
      • ListItem
      • ListItemBehavior
      • ListSelector
      • ListSelectorBehavior
      • Panel
      • ProgressBar
      • UIEvent
      • UIParseHandler
      • UIParser
      • Widget
      • WidgetAnchor
    • Genesis.UI.Items
      • GridViewImageIcon
      • IItem

    Class RenderInstanceContainer

    Represents a container for managing and rendering instanced meshes.

    Inheritance
    object
    GameElement
    RenderInstanceContainer
    Inherited Members
    GameElement.AddBehavior<T>(T)
    GameElement.AddBehavior(IGameBehavior)
    GameElement.GetBehavior<T>()
    GameElement.GetBehaviors<T>()
    GameElement.AddChild(GameElement)
    GameElement.GetInstance(GameElement)
    GameElement.HasTag(string)
    GameElement.Name
    GameElement.Tag
    GameElement.Location
    GameElement.Rotation
    GameElement.Size
    GameElement.Behaviors
    GameElement.Scene
    GameElement.Enabled
    GameElement.Propertys
    GameElement.Children
    GameElement.Parent
    GameElement.UUID
    GameElement.CastShadows
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Genesis.Graphics
    Assembly: Genesis.dll
    Syntax
    public class RenderInstanceContainer : GameElement

    Constructors

    RenderInstanceContainer(InstancedMesh, ShaderProgram)

    Initializes a new instance of the RenderInstanceContainer class with a specified mesh and shader.

    Declaration
    public RenderInstanceContainer(InstancedMesh mesh, ShaderProgram shader)
    Parameters
    Type Name Description
    InstancedMesh mesh

    The instanced mesh to add.

    ShaderProgram shader

    The shader program to use for rendering.

    RenderInstanceContainer(ShaderProgram)

    Initializes a new instance of the RenderInstanceContainer class with a specified shader.

    Declaration
    public RenderInstanceContainer(ShaderProgram shader)
    Parameters
    Type Name Description
    ShaderProgram shader

    The shader program to use for rendering.

    Properties

    Meshes

    Gets or sets the collection of instanced meshes.

    Declaration
    public List<InstancedMesh> Meshes { get; set; }
    Property Value
    Type Description
    List<InstancedMesh>

    Shader

    Gets or sets the shader program used for rendering the instances.

    Declaration
    public ShaderProgram Shader { get; set; }
    Property Value
    Type Description
    ShaderProgram

    UpdateInstances

    Gets or sets a value indicating whether the instances need to be updated.

    Declaration
    public bool UpdateInstances { get; set; }
    Property Value
    Type Description
    bool

    Methods

    AddInstance(Vec3, Vec3, Vec3)

    Adds a new instance to the container with specified position, size, and optional rotation.

    Declaration
    public InstancedElement AddInstance(Vec3 position, Vec3 size, Vec3 rotation = default)
    Parameters
    Type Name Description
    Vec3 position

    The position of the instance.

    Vec3 size

    The size of the instance.

    Vec3 rotation

    The rotation of the instance. Default is no rotation.

    Returns
    Type Description
    InstancedElement

    The created InstancedElement.

    GetMatrices()

    Retrieves an array of transformation matrices for all instances.

    Declaration
    public float[] GetMatrices()
    Returns
    Type Description
    float[]

    An array of transformation matrices as floats.

    Init(Game, IRenderDevice)

    Initializes the container with the specified game and render device.

    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
    GameElement.Init(Game, IRenderDevice)

    OnDestroy(Game)

    Cleans up resources associated with the container when it is destroyed.

    Declaration
    public override void OnDestroy(Game game)
    Parameters
    Type Name Description
    Game game

    The game instance.

    Overrides
    GameElement.OnDestroy(Game)

    OnRender(Game, IRenderDevice)

    Renders the container using the specified game and render device.

    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
    GameElement.OnRender(Game, IRenderDevice)

    OnUpdate(Game, IRenderDevice)

    Updates the instances in the container if UpdateInstances is set to true.

    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
    GameElement.OnUpdate(Game, IRenderDevice)

    UpdateInstanceMatrix(int, float[])

    Updates the transformation matrix for a specific instance.

    Declaration
    public void UpdateInstanceMatrix(int instanceId, float[] data)
    Parameters
    Type Name Description
    int instanceId

    The ID of the instance to update.

    float[] data

    The new transformation matrix data.

    In this article
    Back to top Generated by DocFX