Class Render
- Namespace
- Elegy.RenderSystem.API
- Assembly
- Elegy.RenderSystem.dll
The rendering system.
public static class Render
- Inheritance
-
Render
- Inherited Members
Fields
OutputDescBackbuffer
public static readonly OutputDescription OutputDescBackbuffer
Field Value
- OutputDescription
OutputDescDepthOnly
public static readonly OutputDescription OutputDescDepthOnly
Field Value
- OutputDescription
OutputDescNormal
public static readonly OutputDescription OutputDescNormal
Field Value
- OutputDescription
RenderStyle
The style to render the world with.
public static IRenderStyle? RenderStyle
Field Value
Properties
CpuFrametime
Last CPU frametime.
public static double CpuFrametime { get; }
Property Value
Device
The graphics device. Updates buffers, swaps stuff, all kinds of GPU things.
public static GraphicsDevice Device { get; }
Property Value
- GraphicsDevice
Factory
The graphics resource factory. Creates buffers, shaders and all kinds of stuff.
public static ResourceFactory Factory { get; }
Property Value
- ResourceFactory
GpuFrametime
Last GPU frametime.
public static double GpuFrametime { get; }
Property Value
LastFrameTime
Point in time when the last frame was rendered.
public static double LastFrameTime { get; }
Property Value
MaterialTemplates
public static IReadOnlyCollection<MaterialTemplate> MaterialTemplates { get; }
Property Value
Methods
BeginFrame()
Starts the frame timers, clears stuff etc.
public static void BeginFrame()
CreateBatch()
Creates a render batch.
public static Batch CreateBatch()
Returns
CreateBillboard()
Creates a billboard.
public static Billboard CreateBillboard()
Returns
CreateEntity(bool)
Creates a render entity.
public static MeshEntity CreateEntity(bool animated)
Parameters
animated
bool
Returns
CreateGraphicsDevice(string[], string[])
public static GraphicsDevice? CreateGraphicsDevice(string[] extraInstanceExtensions, string[] extraDeviceExtensions)
Parameters
Returns
- GraphicsDevice
CreateLight()
Creates a render light.
public static Light CreateLight()
Returns
CreateMaterial(MaterialDefinition)
Creates a render material.
public static RenderMaterial? CreateMaterial(MaterialDefinition materialDefinition)
Parameters
materialDefinition
MaterialDefinition
Returns
CreateMesh(Model)
Creates a render mesh.
public static Mesh CreateMesh(Model modelData)
Parameters
modelData
Model
Returns
CreateTexture(TextureMetadata, Span<byte>)
Creates a render texture.
public static RenderTexture CreateTexture(TextureMetadata metadata, Span<byte> data)
Parameters
metadata
TextureMetadatadata
Span<byte>
Returns
CreateView(Texture)
Creates a render view from a render target texture.
public static View CreateView(Texture renderTarget)
Parameters
renderTarget
Texture
Returns
CreateView(IWindow)
Creates a render view from a window.
public static View CreateView(IWindow window)
Parameters
window
IWindow
Returns
CreateVolume()
Creates a renderable volume.
public static Volume CreateVolume()
Returns
DebugLine(Vector3, Vector3, Vector4, float, float)
Submits a 3D debug line for debug rendering.
public static void DebugLine(Vector3 start, Vector3 end, Vector4 colour, float lifetime = -3.4028235E+38, float thickness = 1)
Parameters
DebugLine(Vector3, Vector3, float, float)
Submits a 3D debug line for debug rendering.
public static void DebugLine(Vector3 start, Vector3 end, float lifetime = -3.4028235E+38, float thickness = 1)
Parameters
DebugLineScreen(Vector2, Vector2, Vector4, float, float)
Submits a 2D debug line for debug rendering.
public static void DebugLineScreen(Vector2 start, Vector2 end, Vector4 colour, float lifetime = -3.4028235E+38, float thickness = 1)
Parameters
DebugLineScreen(Vector2, Vector2, float, float)
Submits a 2D debug line for debug rendering.
public static void DebugLineScreen(Vector2 start, Vector2 end, float lifetime = -3.4028235E+38, float thickness = 1)
Parameters
EndFrame()
Finishes the frame, timers etc.
public static void EndFrame()
FreeBatch(ref Batch?)
Frees a render batch.
public static bool FreeBatch(ref Batch? batch)
Parameters
batch
Batch
Returns
FreeBillboard(ref Billboard?)
Frees a billboard.
public static bool FreeBillboard(ref Billboard? billboard)
Parameters
billboard
Billboard
Returns
FreeEntity(MeshEntity)
Frees a render entity.
public static bool FreeEntity(MeshEntity entity)
Parameters
entity
MeshEntity
Returns
FreeLight(ref Light?)
Frees a render light.
public static bool FreeLight(ref Light? light)
Parameters
light
Light
Returns
FreeMaterial(ref RenderMaterial?)
Frees a render material.
public static bool FreeMaterial(ref RenderMaterial? material)
Parameters
material
RenderMaterial
Returns
FreeMesh(ref Mesh?)
Frees a render mesh.
public static bool FreeMesh(ref Mesh? mesh)
Parameters
mesh
Mesh
Returns
FreeTexture(ref RenderTexture?)
Frees a render texture.
public static bool FreeTexture(ref RenderTexture? texture)
Parameters
texture
RenderTexture
Returns
FreeView(ref View?)
Frees a view.
public static bool FreeView(ref View? view)
Parameters
view
View
Returns
FreeVolume(ref Volume?)
Frees a renderable volume.
public static bool FreeVolume(ref Volume? volume)
Parameters
volume
Volume
Returns
GetCurrentWindowView()
Gets the current window's view, if any.
public static View? GetCurrentWindowView()
Returns
GetGlobalParameter(string)
public static MaterialParameter? GetGlobalParameter(string name)
Parameters
name
string
Returns
GetGlobalParameterIndex(string)
public static GlobalParameterIndex GetGlobalParameterIndex(string name)
Parameters
name
string
Returns
GetGlobalParameterSet(MaterialParameterSet)
public static MaterialParameterSet? GetGlobalParameterSet(MaterialParameterSet set)
Parameters
Returns
GetGlobalParameterSet(string)
public static MaterialParameterSet? GetGlobalParameterSet(string parameterName)
Parameters
parameterName
string
Returns
GetMaterialTemplate(string)
public static MaterialTemplate GetMaterialTemplate(string name)
Parameters
name
string
Returns
GetOrCreateDefaultView(int, int, int)
Creates a window to render into.
public static View? GetOrCreateDefaultView(int width, int height, int rate = 60)
Parameters
Returns
GetView(IWindow)
Gets the window's view, if any.
public static View? GetView(IWindow window)
Parameters
window
IWindow
Returns
HasMaterialTemplate(string)
public static bool HasMaterialTemplate(string name)
Parameters
name
string
Returns
Init(in LaunchConfig)
public static bool Init(in LaunchConfig config)
Parameters
config
LaunchConfig
Returns
LoadMaterial(string)
Loads or finds a render material by name.
public static RenderMaterial LoadMaterial(string name)
Parameters
name
string
Returns
LoadMesh(string)
Creates/loads a render mesh from a file.
public static Mesh LoadMesh(string name)
Parameters
name
string
Returns
PostInit()
public static bool PostInit()
Returns
PresentView(in View)
Presents the view to its window.
public static void PresentView(in View view)
Parameters
view
View
RenderFrame(View)
Renders everything for a given view.
public static void RenderFrame(View view)
Parameters
view
ViewThe view to render from. Will render and update an Silk.NET.Windowing.IWindow.
RenderFrame(IWindow)
Renders everything for a given window.
public static void RenderFrame(IWindow window)
Parameters
window
IWindowThe window to render into.
RenderView(in View)
Draws a view to the backbuffer.
public static void RenderView(in View view)
Parameters
view
View
SetGlobalParameter(GlobalParameterIndex, RenderTexture)
public static void SetGlobalParameter(GlobalParameterIndex id, RenderTexture value)
Parameters
id
GlobalParameterIndexvalue
RenderTexture
SetGlobalParameter(GlobalParameterIndex, bool)
public static void SetGlobalParameter(GlobalParameterIndex id, bool value)
Parameters
id
GlobalParameterIndexvalue
bool
SetGlobalParameter(GlobalParameterIndex, int)
public static void SetGlobalParameter(GlobalParameterIndex id, int value)
Parameters
id
GlobalParameterIndexvalue
int
SetGlobalParameter(GlobalParameterIndex, Matrix4x4)
public static void SetGlobalParameter(GlobalParameterIndex id, Matrix4x4 value)
Parameters
id
GlobalParameterIndexvalue
Matrix4x4
SetGlobalParameter(GlobalParameterIndex, Vector2)
public static void SetGlobalParameter(GlobalParameterIndex id, Vector2 value)
Parameters
id
GlobalParameterIndexvalue
Vector2
SetGlobalParameter(GlobalParameterIndex, Vector3)
public static void SetGlobalParameter(GlobalParameterIndex id, Vector3 value)
Parameters
id
GlobalParameterIndexvalue
Vector3
SetGlobalParameter(GlobalParameterIndex, Vector4)
public static void SetGlobalParameter(GlobalParameterIndex id, Vector4 value)
Parameters
id
GlobalParameterIndexvalue
Vector4
SetGlobalParameter(GlobalParameterIndex, float)
public static void SetGlobalParameter(GlobalParameterIndex id, float value)
Parameters
id
GlobalParameterIndexvalue
float
SetGlobalParameter(GlobalParameterIndex, Sampler)
public static void SetGlobalParameter(GlobalParameterIndex id, Sampler value)
Parameters
id
GlobalParameterIndexvalue
Sampler
SetInstanceResourceSets(CommandList, MaterialParameterPool, ShaderVariant)
public static void SetInstanceResourceSets(CommandList commands, MaterialParameterPool perInstancePool, ShaderVariant shaderVariant)
Parameters
commands
CommandListperInstancePool
MaterialParameterPoolshaderVariant
ShaderVariant
SetMaterialResourceSets(CommandList, RenderMaterial, ShaderVariant)
public static void SetMaterialResourceSets(CommandList commands, RenderMaterial material, ShaderVariant shaderVariant)
Parameters
commands
CommandListmaterial
RenderMaterialshaderVariant
ShaderVariant
SetMaterialResourceSetsIndividual(CommandList, int[], ReadOnlySpan<MaterialParameterSet>)
public static void SetMaterialResourceSetsIndividual(CommandList commands, int[] mappings, ReadOnlySpan<MaterialParameterSet> parameterSets)
Parameters
commands
CommandListmappings
int[]parameterSets
ReadOnlySpan<MaterialParameterSet>
SetRenderView(CommandList, in View)
public static void SetRenderView(CommandList commands, in View view)
Parameters
commands
CommandListview
View
Shutdown()
public static void Shutdown()
UpdateBuffers()
Updates all MeshEntity, View etc. instances if their render data changed.
public static void UpdateBuffers()
Events
OnRender
What to render every frame.
public static event Action? OnRender