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
animatedbool
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
materialDefinitionMaterialDefinition
Returns
CreateMesh(Model)
Creates a render mesh.
public static Mesh CreateMesh(Model modelData)
Parameters
modelDataModel
Returns
CreateTexture(TextureMetadata, Span<byte>)
Creates a render texture.
public static RenderTexture CreateTexture(TextureMetadata metadata, Span<byte> data)
Parameters
metadataTextureMetadatadataSpan<byte>
Returns
CreateView(Texture)
Creates a render view from a render target texture.
public static View CreateView(Texture renderTarget)
Parameters
renderTargetTexture
Returns
CreateView(IWindow)
Creates a render view from a window.
public static View CreateView(IWindow window)
Parameters
windowIWindow
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
batchBatch
Returns
FreeBillboard(ref Billboard?)
Frees a billboard.
public static bool FreeBillboard(ref Billboard? billboard)
Parameters
billboardBillboard
Returns
FreeEntity(MeshEntity)
Frees a render entity.
public static bool FreeEntity(MeshEntity entity)
Parameters
entityMeshEntity
Returns
FreeLight(ref Light?)
Frees a render light.
public static bool FreeLight(ref Light? light)
Parameters
lightLight
Returns
FreeMaterial(ref RenderMaterial?)
Frees a render material.
public static bool FreeMaterial(ref RenderMaterial? material)
Parameters
materialRenderMaterial
Returns
FreeMesh(ref Mesh?)
Frees a render mesh.
public static bool FreeMesh(ref Mesh? mesh)
Parameters
meshMesh
Returns
FreeTexture(ref RenderTexture?)
Frees a render texture.
public static bool FreeTexture(ref RenderTexture? texture)
Parameters
textureRenderTexture
Returns
FreeView(ref View?)
Frees a view.
public static bool FreeView(ref View? view)
Parameters
viewView
Returns
FreeVolume(ref Volume?)
Frees a renderable volume.
public static bool FreeVolume(ref Volume? volume)
Parameters
volumeVolume
Returns
GetCurrentWindowView()
Gets the current window's view, if any.
public static View? GetCurrentWindowView()
Returns
GetGlobalParameter(string)
public static MaterialParameter? GetGlobalParameter(string name)
Parameters
namestring
Returns
GetGlobalParameterIndex(string)
public static GlobalParameterIndex GetGlobalParameterIndex(string name)
Parameters
namestring
Returns
GetGlobalParameterSet(MaterialParameterSet)
public static MaterialParameterSet? GetGlobalParameterSet(MaterialParameterSet set)
Parameters
Returns
GetGlobalParameterSet(string)
public static MaterialParameterSet? GetGlobalParameterSet(string parameterName)
Parameters
parameterNamestring
Returns
GetMaterialTemplate(string)
public static MaterialTemplate GetMaterialTemplate(string name)
Parameters
namestring
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
windowIWindow
Returns
HasMaterialTemplate(string)
public static bool HasMaterialTemplate(string name)
Parameters
namestring
Returns
Init(in LaunchConfig)
public static bool Init(in LaunchConfig config)
Parameters
configLaunchConfig
Returns
LoadMaterial(string)
Loads or finds a render material by name.
public static RenderMaterial LoadMaterial(string name)
Parameters
namestring
Returns
LoadMesh(string)
Creates/loads a render mesh from a file.
public static Mesh LoadMesh(string name)
Parameters
namestring
Returns
PostInit()
public static bool PostInit()
Returns
PresentView(in View)
Presents the view to its window.
public static void PresentView(in View view)
Parameters
viewView
RenderFrame(View)
Renders everything for a given view.
public static void RenderFrame(View view)
Parameters
viewViewThe 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
windowIWindowThe window to render into.
RenderView(in View)
Draws a view to the backbuffer.
public static void RenderView(in View view)
Parameters
viewView
SetGlobalParameter(GlobalParameterIndex, RenderTexture)
public static void SetGlobalParameter(GlobalParameterIndex id, RenderTexture value)
Parameters
idGlobalParameterIndexvalueRenderTexture
SetGlobalParameter(GlobalParameterIndex, bool)
public static void SetGlobalParameter(GlobalParameterIndex id, bool value)
Parameters
idGlobalParameterIndexvaluebool
SetGlobalParameter(GlobalParameterIndex, int)
public static void SetGlobalParameter(GlobalParameterIndex id, int value)
Parameters
idGlobalParameterIndexvalueint
SetGlobalParameter(GlobalParameterIndex, Matrix4x4)
public static void SetGlobalParameter(GlobalParameterIndex id, Matrix4x4 value)
Parameters
idGlobalParameterIndexvalueMatrix4x4
SetGlobalParameter(GlobalParameterIndex, Vector2)
public static void SetGlobalParameter(GlobalParameterIndex id, Vector2 value)
Parameters
idGlobalParameterIndexvalueVector2
SetGlobalParameter(GlobalParameterIndex, Vector3)
public static void SetGlobalParameter(GlobalParameterIndex id, Vector3 value)
Parameters
idGlobalParameterIndexvalueVector3
SetGlobalParameter(GlobalParameterIndex, Vector4)
public static void SetGlobalParameter(GlobalParameterIndex id, Vector4 value)
Parameters
idGlobalParameterIndexvalueVector4
SetGlobalParameter(GlobalParameterIndex, float)
public static void SetGlobalParameter(GlobalParameterIndex id, float value)
Parameters
idGlobalParameterIndexvaluefloat
SetGlobalParameter(GlobalParameterIndex, Sampler)
public static void SetGlobalParameter(GlobalParameterIndex id, Sampler value)
Parameters
idGlobalParameterIndexvalueSampler
SetInstanceResourceSets(CommandList, MaterialParameterPool, ShaderVariant)
public static void SetInstanceResourceSets(CommandList commands, MaterialParameterPool perInstancePool, ShaderVariant shaderVariant)
Parameters
commandsCommandListperInstancePoolMaterialParameterPoolshaderVariantShaderVariant
SetMaterialResourceSets(CommandList, RenderMaterial, ShaderVariant)
public static void SetMaterialResourceSets(CommandList commands, RenderMaterial material, ShaderVariant shaderVariant)
Parameters
commandsCommandListmaterialRenderMaterialshaderVariantShaderVariant
SetMaterialResourceSetsIndividual(CommandList, int[], ReadOnlySpan<MaterialParameterSet>)
public static void SetMaterialResourceSetsIndividual(CommandList commands, int[] mappings, ReadOnlySpan<MaterialParameterSet> parameterSets)
Parameters
commandsCommandListmappingsint[]parameterSetsReadOnlySpan<MaterialParameterSet>
SetRenderView(CommandList, in View)
public static void SetRenderView(CommandList commands, in View view)
Parameters
commandsCommandListviewView
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