Class RenderContextImp
Implementation of the IRenderContextImp interface for usage with OpenTK framework.
Inheritance
Implements
Inherited Members
Namespace: Fusee.Engine.Imp.Graphics.Desktop
Assembly: Fusee.Engine.Imp.Graphics.Desktop.dll
Syntax
public class RenderContextImp : IRenderContextImp
Constructors
RenderContextImp(IRenderCanvasImp)
Initializes a new instance of the RenderContextImp class.
Declaration
public RenderContextImp(IRenderCanvasImp renderCanvas)
Parameters
| Type | Name | Description |
|---|---|---|
| IRenderCanvasImp | renderCanvas | The render canvas interface. |
RenderContextImp(IRenderCanvasImp, FuseePlatformId)
Current workaround to differentiate between "Desktop" and "Mesa" (Software Rasterizer used for the RenderTests in the CI)
Declaration
public RenderContextImp(IRenderCanvasImp renderCanvas, FuseePlatformId platformID)
Parameters
| Type | Name | Description |
|---|---|---|
| IRenderCanvasImp | renderCanvas | |
| FuseePlatformId | platformID |
Properties
ClearColor
Gets and sets the color of the background.
Declaration
public float4 ClearColor { get; set; }
Property Value
| Type | Description |
|---|---|
| float4 | The color of the clear. |
ClearDepth
Gets and sets the clear depth value which is used to clear the depth buffer.
Declaration
public float ClearDepth { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single | Specifies the depth value used when the depth buffer is cleared. The initial value is 1. This value is clamped to the range [0,1]. |
FuseePlatformId
Constant id that describes the renderer. This can be used in shaders to do platform dependent things.
Declaration
public FuseePlatformId FuseePlatformId { get; }
Property Value
| Type | Description |
|---|---|
| FuseePlatformId |
Methods
AttacheTextureToFbo(IRenderTarget, Boolean, ITextureHandle, Int32)
Attaches a texture to the frame buffer object, associated with the given render target.
Declaration
public void AttacheTextureToFbo(IRenderTarget renderTarget, bool isDepthTex, ITextureHandle texHandle, int attachment = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| IRenderTarget | renderTarget | The render target. |
| System.Boolean | isDepthTex | Determines if the texture is a depth texture. In this case the texture is attached to |
| ITextureHandle | texHandle | The gpu handle of the texture. |
| System.Int32 | attachment | Number of the fbo attachment. For example: attachment = 1 will attach the texture to |
BlitMultisample2DTextureToTexture(IWritableTexture, IWritableTexture)
Takes a WritableMultisampleTexture and blits the result of all samples into an existing WritableTexture for further use (e. g. bind and use as Albedo texture)
Declaration
public void BlitMultisample2DTextureToTexture(IWritableTexture input, IWritableTexture output)
Parameters
| Type | Name | Description |
|---|---|---|
| IWritableTexture | input | WritableMultisampleTexture |
| IWritableTexture | output | WritableTexture |
Clear(ClearFlags)
Clears the specified flags.
Declaration
public void Clear(ClearFlags flags)
Parameters
| Type | Name | Description |
|---|---|---|
| ClearFlags | flags | The flags. |
ColorMask(Boolean, Boolean, Boolean, Boolean)
Enable or disable Color channels to be written to the frame buffer (final image). Use this function as a color channel filter for the final image.
Declaration
public void ColorMask(bool red, bool green, bool blue, bool alpha)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | red | if set to |
| System.Boolean | green | if set to |
| System.Boolean | blue | if set to |
| System.Boolean | alpha | if set to |
ConnectBufferToShaderStorage(IShaderHandle, IStorageBuffer, String)
Connects the given SSBO to the currently active shader program.
Declaration
public void ConnectBufferToShaderStorage(IShaderHandle currentProgram, IStorageBuffer buffer, string ssboName)
Parameters
| Type | Name | Description |
|---|---|---|
| IShaderHandle | currentProgram | The handle of the current shader program. |
| IStorageBuffer | buffer | The Storage Buffer object on the CPU. |
| System.String | ssboName | The SSBO's name. |
CreateGBufferTarget(TexRes)
Creates a IRenderTarget with the purpose of being used as CPU GBuffer representation.
Declaration
public IRenderTarget CreateGBufferTarget(TexRes res)
Parameters
| Type | Name | Description |
|---|---|---|
| TexRes | res | The texture resolution. |
Returns
| Type | Description |
|---|---|
| IRenderTarget |
CreateInstanceDataImp(IMeshImp)
Creates the instance data implementation.
Declaration
public IInstanceDataImp CreateInstanceDataImp(IMeshImp meshImp)
Parameters
| Type | Name | Description |
|---|---|---|
| IMeshImp | meshImp |
Returns
| Type | Description |
|---|---|
| IInstanceDataImp | The IInstanceDataImp instance. |
CreateMeshImp()
Creates the mesh implementation.
Declaration
public IMeshImp CreateMeshImp()
Returns
| Type | Description |
|---|---|
| IMeshImp | The IMeshImp instance. |
CreateShaderProgram(String, String, String)
Creates the shader program by using a valid GLSL vertex and fragment shader code. This code is compiled at runtime. Do not use this function in frequent updates.
Declaration
public IShaderHandle CreateShaderProgram(string vs, string ps, string gs = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | vs | The vertex shader code. |
| System.String | ps | The pixel(=fragment) shader code. |
| System.String | gs | The geometry shader code. |
Returns
| Type | Description |
|---|---|
| IShaderHandle | An instance of IShaderHandle. |
Exceptions
| Type | Condition |
|---|---|
| System.ApplicationException |
CreateShaderProgramCompute(String)
Creates a shader object from compute shader source code.
Declaration
public IShaderHandle CreateShaderProgramCompute(string cs)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | cs | A string containing the compute shader source. |
Returns
| Type | Description |
|---|---|
| IShaderHandle |
CreateTexture(ITexture)
Creates a new Texture and binds it to the shader.
Declaration
public ITextureHandle CreateTexture(ITexture img)
Parameters
| Type | Name | Description |
|---|---|---|
| ITexture | img | A given ITexture object, containing all necessary information for the upload to the graphics card. |
Returns
| Type | Description |
|---|---|
| ITextureHandle | An ITextureHandle that can be used for texturing in the shader. In this implementation, the handle is an integer-value which is necessary for OpenTK. |
CreateTexture(IWritableArrayTexture)
Creates a new Texture and binds it to the shader.
Declaration
public ITextureHandle CreateTexture(IWritableArrayTexture img)
Parameters
| Type | Name | Description |
|---|---|---|
| IWritableArrayTexture | img | A given ImageData object, containing all necessary information for the upload to the graphics card. |
Returns
| Type | Description |
|---|---|
| ITextureHandle | An ITextureHandle that can be used for texturing in the shader. In this implementation, the handle is an integer-value which is necessary for OpenTK. |
CreateTexture(IWritableCubeMap)
Creates a new CubeMap and binds it to the shader.
Declaration
public ITextureHandle CreateTexture(IWritableCubeMap img)
Parameters
| Type | Name | Description |
|---|---|---|
| IWritableCubeMap | img | A given IWritableCubeMap object, containing all necessary information for the upload to the graphics card. |
Returns
| Type | Description |
|---|---|
| ITextureHandle | An ITextureHandle that can be used for texturing in the shader. In this implementation, the handle is an integer-value which is necessary for OpenTK. |
CreateTexture(IWritableTexture)
Creates a new Texture and binds it to the shader.
Declaration
public ITextureHandle CreateTexture(IWritableTexture tex)
Parameters
| Type | Name | Description |
|---|---|---|
| IWritableTexture | tex | A given IWritableTexture object, containing all necessary information for the upload to the graphics card. |
Returns
| Type | Description |
|---|---|
| ITextureHandle | An ITextureHandle that can be used for texturing in the shader. In this implementation, the handle is an integer-value which is necessary for OpenTK. |
CreateTexture(Texture1D)
Creates a new Texture and binds it to the shader.
Declaration
public ITextureHandle CreateTexture(Texture1D tex)
Parameters
| Type | Name | Description |
|---|---|---|
| Texture1D | tex | A given IWritableTexture object, containing all necessary information for the upload to the graphics card. |
Returns
| Type | Description |
|---|---|
| ITextureHandle | An ITextureHandle that can be used for texturing in the shader. In this implementation, the handle is an integer-value which is necessary for OpenTK. |
DebugLine(float3, float3, float4)
Draws a Debug Line in 3D Space by using a start and end point (float3).
Declaration
public void DebugLine(float3 start, float3 end, float4 color)
Parameters
| Type | Name | Description |
|---|---|---|
| float3 | start | The starting point of the DebugLine. |
| float3 | end | The endpoint of the DebugLine. |
| float4 | color | The color of the DebugLine. |
DeleteFrameBuffer(IBufferHandle)
Free all allocated gpu memory that belong to a frame-buffer object.
Declaration
public void DeleteFrameBuffer(IBufferHandle bh)
Parameters
| Type | Name | Description |
|---|---|---|
| IBufferHandle | bh | The platform dependent abstraction of the gpu buffer handle. |
DeleteRenderBuffer(IBufferHandle)
Free all allocated gpu memory that belong to a render-buffer object.
Declaration
public void DeleteRenderBuffer(IBufferHandle bh)
Parameters
| Type | Name | Description |
|---|---|---|
| IBufferHandle | bh | The platform dependent abstraction of the gpu buffer handle. |
DeleteStorageBuffer(IBufferHandle)
Deletes the shader storage buffer on the GPU.
Declaration
public void DeleteStorageBuffer(IBufferHandle storageBufferHandle)
Parameters
| Type | Name | Description |
|---|---|---|
| IBufferHandle | storageBufferHandle | The buffer object. |
DetachTextureFromFbo(IRenderTarget, Boolean, Int32)
Detaches a texture from the frame buffer object, associated with the given render target.
Declaration
public void DetachTextureFromFbo(IRenderTarget renderTarget, bool isDepthTex, int attachment = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| IRenderTarget | renderTarget | The render target. |
| System.Boolean | isDepthTex | Determines if the texture is a depth texture. In this case the texture currently associated with |
| System.Int32 | attachment | Number of the fbo attachment. For example: attachment = 1 will detach the texture currently associated with |
DisableDepthClamp()
Disables depths clamping. EnableDepthClamp()
Declaration
public void DisableDepthClamp()
DispatchCompute(Int32, Int32, Int32, Int32)
Launch the bound Compute Shader Program.
Declaration
public void DispatchCompute(int kernelIndex, int threadGroupsX, int threadGroupsY, int threadGroupsZ)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | kernelIndex | |
| System.Int32 | threadGroupsX | The number of work groups to be launched in the X dimension. |
| System.Int32 | threadGroupsY | The number of work groups to be launched in the Y dimension. |
| System.Int32 | threadGroupsZ | he number of work groups to be launched in the Z dimension. |
EnableDepthClamp()
The clipping behavior against the Z position of a vertex can be turned off by activating depth clamping. This is done with glEnable(GL_DEPTH_CLAMP). This will cause the clip-space Z to remain unclipped by the front and rear viewing volume. See: https://www.khronos.org/opengl/wiki/Vertex_Post-Processing#Depth_clamping
Declaration
public void EnableDepthClamp()
GetActiveUniformsList(IShaderHandle)
Gets the shader parameter list of a specific IShaderHandle.
Declaration
public IList<IActiveUniform> GetActiveUniformsList(IShaderHandle shaderProgram)
Parameters
| Type | Name | Description |
|---|---|---|
| IShaderHandle | shaderProgram | The shader program. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IList<IActiveUniform> | All Shader parameters of a shader program are returned. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentOutOfRangeException |
GetBufferContent(Rectangle, ITextureHandle)
Gets the content of the buffer.
Declaration
public void GetBufferContent(Rectangle quad, ITextureHandle texId)
Parameters
| Type | Name | Description |
|---|---|---|
| Rectangle | quad | The Rectangle where the content is draw into. |
| ITextureHandle | texId | The texture identifier. |
GetHardwareCapabilities(HardwareCapability)
Returns the capabilities of the underlying graphics hardware
Declaration
public uint GetHardwareCapabilities(HardwareCapability capability)
Parameters
| Type | Name | Description |
|---|---|---|
| HardwareCapability | capability |
Returns
| Type | Description |
|---|---|
| System.UInt32 | uint |
GetHardwareDescription()
Returns a human readable description of the underlying graphics hardware. This implementation reports GL_VENDOR, GL_RENDERER, GL_VERSION and GL_EXTENSIONS.
Declaration
public string GetHardwareDescription()
Returns
| Type | Description |
|---|---|
| System.String |
GetParamValue(IShaderHandle, IUniformHandle)
Gets the float parameter value inside a shader program by using a IUniformHandle as search reference. Do not use this function in frequent updates as it transfers information from graphics card to the cpu which takes time.
Declaration
public float GetParamValue(IShaderHandle program, IUniformHandle param)
Parameters
| Type | Name | Description |
|---|---|---|
| IShaderHandle | program | The program. |
| IUniformHandle | param | The parameter. |
Returns
| Type | Description |
|---|---|
| System.Single | A float number (default is 0). |
GetPixelColor(Int32, Int32, Int32, Int32)
Retrieves a sub-image of the given region.
Declaration
public IImageData GetPixelColor(int x, int y, int w = 1, int h = 1)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | x | The x value of the start of the region. |
| System.Int32 | y | The y value of the start of the region. |
| System.Int32 | w | The width to copy. |
| System.Int32 | h | The height to copy. |
Returns
| Type | Description |
|---|---|
| IImageData | The specified sub-image |
GetPixelDepth(Int32, Int32)
Retrieves the Z-value at the given pixel position.
Declaration
public float GetPixelDepth(int x, int y)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | x | The x value. |
| System.Int32 | y | The y value. |
Returns
| Type | Description |
|---|---|
| System.Single | The Z value at (x, y). |
GetRenderState(RenderState)
Gets the current RenderState that is applied to the current OpenGL based RenderContext.
Declaration
public uint GetRenderState(RenderState renderState)
Parameters
| Type | Name | Description |
|---|---|---|
| RenderState | renderState | State of the render. See RenderState for further information. |
Returns
| Type | Description |
|---|---|
| System.UInt32 |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentOutOfRangeException | pm;Value + ((PolygonMode)pm) + not handled or depFunc;Value + ((DepthFunction)depFunc) + not handled or renderState |
GetShaderStorageBufferList(IShaderHandle)
Returns a List of type ActiveUniform for all ShaderStorageBlocks
Declaration
public IList<IActiveUniform> GetShaderStorageBufferList(IShaderHandle shaderProgram)
Parameters
| Type | Name | Description |
|---|---|---|
| IShaderHandle | shaderProgram | The shader program to query. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IList<IActiveUniform> |
GetShaderUniformParam(IShaderHandle, String)
Gets the shader parameter. The Shader parameter is used to bind values inside of shader programs that run on the graphics card. Do not use this function in frequent updates as it transfers information from graphics card to the cpu which takes time.
Declaration
public IUniformHandle GetShaderUniformParam(IShaderHandle shaderProgram, string paramName)
Parameters
| Type | Name | Description |
|---|---|---|
| IShaderHandle | shaderProgram | The shader program. |
| System.String | paramName | Name of the parameter. |
Returns
| Type | Description |
|---|---|
| IUniformHandle | The Shader parameter is returned if the name is found, otherwise null. |
MemoryBarrier()
Defines a barrier ordering memory transactions. At the moment it will insert all supported barriers.
Declaration
public void MemoryBarrier()
RemoveBiTangents(IMeshImp)
Deletes the buffer associated with the mesh implementation.
Declaration
public void RemoveBiTangents(IMeshImp mr)
Parameters
| Type | Name | Description |
|---|---|---|
| IMeshImp | mr | The mesh which buffer respectively GPU memory should be deleted. |
RemoveBoneIndices(IMeshImp)
Deletes the buffer associated with the mesh implementation.
Declaration
public void RemoveBoneIndices(IMeshImp mr)
Parameters
| Type | Name | Description |
|---|---|---|
| IMeshImp | mr | The mesh which buffer respectively GPU memory should be deleted. |
RemoveBoneWeights(IMeshImp)
Deletes the buffer associated with the mesh implementation.
Declaration
public void RemoveBoneWeights(IMeshImp mr)
Parameters
| Type | Name | Description |
|---|---|---|
| IMeshImp | mr | The mesh which buffer respectively GPU memory should be deleted. |
RemoveColors(IMeshImp)
Deletes the buffer associated with the mesh implementation.
Declaration
public void RemoveColors(IMeshImp mr)
Parameters
| Type | Name | Description |
|---|---|---|
| IMeshImp | mr | The mesh which buffer respectively GPU memory should be deleted. |
RemoveColors1(IMeshImp)
Deletes the buffer associated with the mesh implementation.
Declaration
public void RemoveColors1(IMeshImp mr)
Parameters
| Type | Name | Description |
|---|---|---|
| IMeshImp | mr | The mesh which buffer respectively GPU memory should be deleted. |
RemoveColors2(IMeshImp)
Deletes the buffer associated with the mesh implementation.
Declaration
public void RemoveColors2(IMeshImp mr)
Parameters
| Type | Name | Description |
|---|---|---|
| IMeshImp | mr | The mesh which buffer respectively GPU memory should be deleted. |
RemoveFlags(IMeshImp)
Deletes the buffer associated with the mesh implementation.
Declaration
public void RemoveFlags(IMeshImp mr)
Parameters
| Type | Name | Description |
|---|---|---|
| IMeshImp | mr | The mesh which buffer respectively GPU memory should be deleted. |
RemoveInstanceData(IInstanceDataImp)
Deletes the buffer associated with the mesh implementation.
Declaration
public void RemoveInstanceData(IInstanceDataImp instanceImp)
Parameters
| Type | Name | Description |
|---|---|---|
| IInstanceDataImp | instanceImp | The instance data whose buffers are to be deleted. |
RemoveNormals(IMeshImp)
Deletes the buffer associated with the mesh implementation.
Declaration
public void RemoveNormals(IMeshImp mr)
Parameters
| Type | Name | Description |
|---|---|---|
| IMeshImp | mr | The mesh which buffer respectively GPU memory should be deleted. |
RemoveShader(IShaderHandle)
Removes shader from the GPU
Declaration
public void RemoveShader(IShaderHandle sp)
Parameters
| Type | Name | Description |
|---|---|---|
| IShaderHandle | sp |
RemoveTangents(IMeshImp)
Deletes the buffer associated with the mesh implementation.
Declaration
public void RemoveTangents(IMeshImp mr)
Parameters
| Type | Name | Description |
|---|---|---|
| IMeshImp | mr | The mesh which buffer respectively GPU memory should be deleted. |
RemoveTextureHandle(ITextureHandle)
Free all allocated gpu memory that belong to the given ITextureHandle.
Declaration
public void RemoveTextureHandle(ITextureHandle textureHandle)
Parameters
| Type | Name | Description |
|---|---|---|
| ITextureHandle | textureHandle | The ITextureHandle which gpu allocated memory will be freed. |
RemoveTriangles(IMeshImp)
Deletes the buffer associated with the mesh implementation.
Declaration
public void RemoveTriangles(IMeshImp mr)
Parameters
| Type | Name | Description |
|---|---|---|
| IMeshImp | mr | The mesh which buffer respectively GPU memory should be deleted. |
RemoveUVs(IMeshImp)
Deletes the buffer associated with the mesh implementation.
Declaration
public void RemoveUVs(IMeshImp mr)
Parameters
| Type | Name | Description |
|---|---|---|
| IMeshImp | mr | The mesh which buffer respectively GPU memory should be deleted. |
RemoveVertices(IMeshImp)
Deletes the buffer associated with the mesh implementation.
Declaration
public void RemoveVertices(IMeshImp mr)
Parameters
| Type | Name | Description |
|---|---|---|
| IMeshImp | mr | The mesh whose buffers respectively GPU memory should be deleted. |
Render(IMeshImp, IInstanceDataImp)
Renders the specified IMeshImp.
Declaration
public void Render(IMeshImp mr, IInstanceDataImp instanceData = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IMeshImp | mr | The IMeshImp instance. |
| IInstanceDataImp | instanceData | Optional parameter for using instance rendering. |
Scissor(Int32, Int32, Int32, Int32)
Only pixels that lie within the scissor box can be modified by drawing commands. Note that the Scissor test must be enabled for this to work.
Declaration
public void Scissor(int x, int y, int width, int height)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | x | X Coordinate of the lower left point of the scissor box. |
| System.Int32 | y | Y Coordinate of the lower left point of the scissor box. |
| System.Int32 | width | Width of the scissor box. |
| System.Int32 | height | Height of the scissor box. |
SetActiveAndBindTexture(IUniformHandle, ITextureHandle, TextureType)
Sets a texture active and binds it.
Declaration
public void SetActiveAndBindTexture(IUniformHandle param, ITextureHandle texId, TextureType texTarget)
Parameters
| Type | Name | Description |
|---|---|---|
| IUniformHandle | param | The shader parameter, associated with this texture. |
| ITextureHandle | texId | The texture handle. |
| TextureType | texTarget | The texture type, describing to which texture target the texture gets bound to. |
SetActiveAndBindTexture(IUniformHandle, ITextureHandle, TextureType, out Int32)
Sets a texture active and binds it.
Declaration
public void SetActiveAndBindTexture(IUniformHandle param, ITextureHandle texId, TextureType texTarget, out int texUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| IUniformHandle | param | The shader parameter, associated with this texture. |
| ITextureHandle | texId | The texture handle. |
| TextureType | texTarget | The texture type, describing to which texture target the texture gets bound to. |
| System.Int32 | texUnit | The texture unit. |
SetActiveAndBindTextureArray(IUniformHandle, ITextureHandle[], TextureType)
Sets a given Shader Parameter to a created texture
Declaration
public void SetActiveAndBindTextureArray(IUniformHandle param, ITextureHandle[] texIds, TextureType texTarget)
Parameters
| Type | Name | Description |
|---|---|---|
| IUniformHandle | param | Shader Parameter used for texture binding |
| ITextureHandle[] | texIds | An array of ITextureHandles returned from CreateTexture method or the ShaderEffectManager. |
| TextureType | texTarget | The texture type, describing to which texture target the texture gets bound to. |
SetActiveAndBindTextureArray(IUniformHandle, ITextureHandle[], TextureType, out Int32[])
Sets a texture active and binds it.
Declaration
public void SetActiveAndBindTextureArray(IUniformHandle param, ITextureHandle[] texIds, TextureType texTarget, out int[] texUnitArray)
Parameters
| Type | Name | Description |
|---|---|---|
| IUniformHandle | param | The shader parameter, associated with this texture. |
| ITextureHandle[] | texIds | An array of ITextureHandles returned from CreateTexture method or the ShaderEffectManager. |
| TextureType | texTarget | The texture type, describing to which texture target the texture gets bound to. |
| System.Int32[] | texUnitArray | The texture units. |
SetBiTangents(IMeshImp, ReadOnlySpan<float3>)
Binds the bitangents onto the GL Render context and assigns an BiTangentBuffer index to the passed IMeshImp instance.
Declaration
public void SetBiTangents(IMeshImp mr, ReadOnlySpan<float3> bitangents)
Parameters
| Type | Name | Description |
|---|---|---|
| IMeshImp | mr | The IMeshImp instance. |
| System.ReadOnlySpan<float3> | bitangents | The BiTangents. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | BiTangents must not be null or empty |
| System.ApplicationException |
SetBoneIndices(IMeshImp, ReadOnlySpan<float4>)
Binds the bone indices onto the GL Render context and assigns an BoneIndexBuffer index to the passed IMeshImp instance.
Declaration
public void SetBoneIndices(IMeshImp mr, ReadOnlySpan<float4> boneIndices)
Parameters
| Type | Name | Description |
|---|---|---|
| IMeshImp | mr | The IMeshImp instance. |
| System.ReadOnlySpan<float4> | boneIndices | The bone indices. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | BoneIndices must not be null or empty |
| System.ApplicationException |
SetBoneWeights(IMeshImp, ReadOnlySpan<float4>)
Binds the bone weights onto the GL Render context and assigns an BoneWeightBuffer index to the passed IMeshImp instance.
Declaration
public void SetBoneWeights(IMeshImp mr, ReadOnlySpan<float4> boneWeights)
Parameters
| Type | Name | Description |
|---|---|---|
| IMeshImp | mr | The IMeshImp instance. |
| System.ReadOnlySpan<float4> | boneWeights | The bone weights. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | BoneWeights must not be null or empty |
| System.ApplicationException |
SetColors(IMeshImp, ReadOnlySpan<UInt32>)
Binds the colors onto the GL Render context and assigns an ColorBuffer index to the passed IMeshImp instance.
Declaration
public void SetColors(IMeshImp mr, ReadOnlySpan<uint> colors)
Parameters
| Type | Name | Description |
|---|---|---|
| IMeshImp | mr | The IMeshImp instance. |
| System.ReadOnlySpan<System.UInt32> | colors | The colors. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | colors must not be null or empty |
| System.ApplicationException |
SetColors1(IMeshImp, ReadOnlySpan<UInt32>)
Binds the colors onto the GL Render context and assigns an ColorBuffer index to the passed IMeshImp instance.
Declaration
public void SetColors1(IMeshImp mr, ReadOnlySpan<uint> colors)
Parameters
| Type | Name | Description |
|---|---|---|
| IMeshImp | mr | The IMeshImp instance. |
| System.ReadOnlySpan<System.UInt32> | colors | The colors. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | colors must not be null or empty |
| System.ApplicationException |
SetColors2(IMeshImp, ReadOnlySpan<UInt32>)
Binds the colors onto the GL Render context and assigns an ColorBuffer index to the passed IMeshImp instance.
Declaration
public void SetColors2(IMeshImp mr, ReadOnlySpan<uint> colors)
Parameters
| Type | Name | Description |
|---|---|---|
| IMeshImp | mr | The IMeshImp instance. |
| System.ReadOnlySpan<System.UInt32> | colors | The colors. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | colors must not be null or empty |
| System.ApplicationException |
SetFlags(IMeshImp, ReadOnlySpan<UInt32>)
Binds the flags onto the GL Render context and assigns a buffer index to the passed IMeshImp instance.
Declaration
public void SetFlags(IMeshImp mr, ReadOnlySpan<uint> flags)
Parameters
| Type | Name | Description |
|---|---|---|
| IMeshImp | mr | The IMeshImp instance. |
| System.ReadOnlySpan<System.UInt32> | flags | The flags. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Flags must not be null or empty |
| System.ApplicationException |
SetInstanceColor(IInstanceDataImp, float4[])
Creates or updates the instance color buffer..
Declaration
public void SetInstanceColor(IInstanceDataImp instanceImp, float4[] instanceColors)
Parameters
| Type | Name | Description |
|---|---|---|
| IInstanceDataImp | instanceImp | The Fusee.Engine.Imp.Graphics.Desktop.InstanceDataImp. |
| float4[] | instanceColors | The colors of the instances. |
SetInstanceTransform(IInstanceDataImp, float3[], float3[], float3[])
Creates or updates the instance transform buffer. Positions, scales and rotations become the instance model matrices.
Declaration
public void SetInstanceTransform(IInstanceDataImp instanceImp, float3[] instancePositions, float3[] instanceRotations, float3[] instanceScales)
Parameters
| Type | Name | Description |
|---|---|---|
| IInstanceDataImp | instanceImp | The Fusee.Engine.Imp.Graphics.Desktop.InstanceDataImp. |
| float3[] | instancePositions | The positions of the instances. |
| float3[] | instanceRotations | The rotations of the instances. |
| float3[] | instanceScales | The scales of the instances. |
SetLineWidth(Single)
Specifies the rasterized width of both aliased and antialiased lines.
Declaration
public void SetLineWidth(float width)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | width | The width in px. |
SetNormals(IMeshImp, ReadOnlySpan<float3>)
Binds the normals onto the GL Render context and assigns an NormalBuffer index to the passed IMeshImp instance.
Declaration
public void SetNormals(IMeshImp mr, ReadOnlySpan<float3> normals)
Parameters
| Type | Name | Description |
|---|---|---|
| IMeshImp | mr | The IMeshImp instance. |
| System.ReadOnlySpan<float3> | normals | The normals. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Normals must not be null or empty |
| System.ApplicationException |
SetRenderState(RenderState, UInt32)
Sets the RenderState object onto the current OpenGL based RenderContext.
Declaration
public void SetRenderState(RenderState renderState, uint value)
Parameters
| Type | Name | Description |
|---|---|---|
| RenderState | renderState | State of the render(enum). |
| System.UInt32 | value | The value. See RenderState for detailed information. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentOutOfRangeException | value or value or value or renderState |
SetRenderTarget(IRenderTarget, ITextureHandle[])
Renders into the given textures of the RenderTarget.
Declaration
public void SetRenderTarget(IRenderTarget renderTarget, ITextureHandle[] texHandles)
Parameters
| Type | Name | Description |
|---|---|---|
| IRenderTarget | renderTarget | The render target. |
| ITextureHandle[] | texHandles | The texture handles, associated with the given textures. Each handle should be created by the TextureManager in the RenderContext. |
SetRenderTarget(IWritableArrayTexture, Int32, ITextureHandle)
Renders into the given layer of the array texture.
Declaration
public void SetRenderTarget(IWritableArrayTexture tex, int layer, ITextureHandle texHandle)
Parameters
| Type | Name | Description |
|---|---|---|
| IWritableArrayTexture | tex | The array texture. |
| System.Int32 | layer | The layer to render to. |
| ITextureHandle | texHandle | The texture handle, associated with the given texture. Should be created by the TextureManager in the RenderContext. |
SetRenderTarget(IWritableCubeMap, ITextureHandle)
Renders into the given cube map.
Declaration
public void SetRenderTarget(IWritableCubeMap tex, ITextureHandle texHandle)
Parameters
| Type | Name | Description |
|---|---|---|
| IWritableCubeMap | tex | The texture. |
| ITextureHandle | texHandle | The texture handle, associated with the given cube map. Should be created by the TextureManager in the RenderContext. |
SetRenderTarget(IWritableTexture, ITextureHandle)
Renders into the given texture.
Declaration
public void SetRenderTarget(IWritableTexture tex, ITextureHandle texHandle)
Parameters
| Type | Name | Description |
|---|---|---|
| IWritableTexture | tex | The texture. |
| ITextureHandle | texHandle | The texture handle, associated with the given texture. Should be created by the TextureManager in the RenderContext. |
SetShader(IShaderHandle)
Sets the shader program onto the GL Render context.
Declaration
public void SetShader(IShaderHandle program)
Parameters
| Type | Name | Description |
|---|---|---|
| IShaderHandle | program | The shader program. |
SetShaderParam(IUniformHandle, float2)
Sets a float2 shader parameter.
Declaration
public void SetShaderParam(IUniformHandle param, float2 val)
Parameters
| Type | Name | Description |
|---|---|---|
| IUniformHandle | param | The parameter. |
| float2 | val | The value. |
SetShaderParam(IUniformHandle, float2[])
Sets a float2 array shader parameter.
Declaration
public void SetShaderParam(IUniformHandle param, float2[] val)
Parameters
| Type | Name | Description |
|---|---|---|
| IUniformHandle | param | The parameter. |
| float2[] | val | The value. |
SetShaderParam(IUniformHandle, float3)
Sets a float3 shader parameter.
Declaration
public void SetShaderParam(IUniformHandle param, float3 val)
Parameters
| Type | Name | Description |
|---|---|---|
| IUniformHandle | param | The parameter. |
| float3 | val | The value. |
SetShaderParam(IUniformHandle, float3[])
Sets a float3 array shader parameter.
Declaration
public void SetShaderParam(IUniformHandle param, float3[] val)
Parameters
| Type | Name | Description |
|---|---|---|
| IUniformHandle | param | The parameter. |
| float3[] | val | The value. |
SetShaderParam(IUniformHandle, float4)
Sets a float4 shader parameter.
Declaration
public void SetShaderParam(IUniformHandle param, float4 val)
Parameters
| Type | Name | Description |
|---|---|---|
| IUniformHandle | param | The parameter. |
| float4 | val | The value. |
SetShaderParam(IUniformHandle, float4[])
Sets a float4 array shader parameter.
Declaration
public void SetShaderParam(IUniformHandle param, float4[] val)
Parameters
| Type | Name | Description |
|---|---|---|
| IUniformHandle | param | The parameter. |
| float4[] | val | The value. |
SetShaderParam(IUniformHandle, float4x4)
Sets a float4x4 shader parameter.
Declaration
public void SetShaderParam(IUniformHandle param, float4x4 val)
Parameters
| Type | Name | Description |
|---|---|---|
| IUniformHandle | param | The parameter. |
| float4x4 | val | The value. |
SetShaderParam(IUniformHandle, float4x4[])
Sets a float4x4 array shader parameter.
Declaration
public void SetShaderParam(IUniformHandle param, float4x4[] val)
Parameters
| Type | Name | Description |
|---|---|---|
| IUniformHandle | param | The parameter. |
| float4x4[] | val | The value. |
SetShaderParam(IUniformHandle, int2)
Sets a int2 shader parameter.
Declaration
public void SetShaderParam(IUniformHandle param, int2 val)
Parameters
| Type | Name | Description |
|---|---|---|
| IUniformHandle | param | The parameter. |
| int2 | val | The value. |
SetShaderParam(IUniformHandle, Double)
Sets a double shader parameter.
Declaration
public void SetShaderParam(IUniformHandle param, double val)
Parameters
| Type | Name | Description |
|---|---|---|
| IUniformHandle | param | The parameter. |
| System.Double | val | The value. |
SetShaderParam(IUniformHandle, Int32)
Sets a int shader parameter.
Declaration
public void SetShaderParam(IUniformHandle param, int val)
Parameters
| Type | Name | Description |
|---|---|---|
| IUniformHandle | param | The parameter. |
| System.Int32 | val | The value. |
SetShaderParam(IUniformHandle, Single)
Sets a float shader parameter.
Declaration
public void SetShaderParam(IUniformHandle param, float val)
Parameters
| Type | Name | Description |
|---|---|---|
| IUniformHandle | param | The parameter. |
| System.Single | val | The value. |
SetShaderParamImage(IUniformHandle, ITextureHandle, TextureType, ImagePixelFormat)
Sets a given Shader Parameter to a created texture
Declaration
public void SetShaderParamImage(IUniformHandle param, ITextureHandle texId, TextureType texTarget, ImagePixelFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| IUniformHandle | param | Shader Parameter used for texture binding |
| ITextureHandle | texId | An ITextureHandle probably returned from CreateTexture method |
| TextureType | texTarget | The texture type, describing to which texture target the texture gets bound to. |
| ImagePixelFormat | format | The internal sized format of the texture. |
SetShaderParamTexture(IUniformHandle, ITextureHandle, TextureType)
Sets a given Shader Parameter to a created texture
Declaration
public void SetShaderParamTexture(IUniformHandle param, ITextureHandle texId, TextureType texTarget)
Parameters
| Type | Name | Description |
|---|---|---|
| IUniformHandle | param | Shader Parameter used for texture binding |
| ITextureHandle | texId | An ITextureHandle probably returned from CreateTexture method |
| TextureType | texTarget | The texture type, describing to which texture target the texture gets bound to. |
SetShaderParamTextureArray(IUniformHandle, ITextureHandle[], TextureType)
Sets a given Shader Parameter to a created texture
Declaration
public void SetShaderParamTextureArray(IUniformHandle param, ITextureHandle[] texIds, TextureType texTarget)
Parameters
| Type | Name | Description |
|---|---|---|
| IUniformHandle | param | Shader Parameter used for texture binding |
| ITextureHandle[] | texIds | An array of ITextureHandles probably returned from CreateTexture method |
| TextureType | texTarget | The texture type, describing to which texture target the texture gets bound to. |
SetTangents(IMeshImp, ReadOnlySpan<float4>)
Binds the tangents onto the GL Render context and assigns an TangentBuffer index to the passed IMeshImp instance.
Declaration
public void SetTangents(IMeshImp mr, ReadOnlySpan<float4> tangents)
Parameters
| Type | Name | Description |
|---|---|---|
| IMeshImp | mr | The IMeshImp instance. |
| System.ReadOnlySpan<float4> | tangents | The tangents. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Tangents must not be null or empty |
| System.ApplicationException |
SetTextureFilterMode(ITextureHandle, TextureFilterMode)
Sets the textures filter mode (TextureFilterMode at runtime.
Declaration
public void SetTextureFilterMode(ITextureHandle tex, TextureFilterMode filterMode)
Parameters
| Type | Name | Description |
|---|---|---|
| ITextureHandle | tex | The handle of the texture. |
| TextureFilterMode | filterMode | The new filter mode. |
SetTextureWrapMode(ITextureHandle, TextureWrapMode)
Sets the textures filter mode (TextureWrapMode at runtime.
Declaration
public void SetTextureWrapMode(ITextureHandle tex, TextureWrapMode wrapMode)
Parameters
| Type | Name | Description |
|---|---|---|
| ITextureHandle | tex | The handle of the texture. |
| TextureWrapMode | wrapMode | The new wrap mode. |
SetTriangles(IMeshImp, ReadOnlySpan<UInt32>)
Binds the triangles onto the GL Render context and assigns an ElementBuffer index to the passed IMeshImp instance.
Declaration
public void SetTriangles(IMeshImp mr, ReadOnlySpan<uint> triangleIndices)
Parameters
| Type | Name | Description |
|---|---|---|
| IMeshImp | mr | The IMeshImp instance. |
| System.ReadOnlySpan<System.UInt32> | triangleIndices | The triangle indices. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | triangleIndices must not be null or empty |
| System.ApplicationException |
SetUVs(IMeshImp, ReadOnlySpan<float2>)
Binds the UV coordinates onto the GL Render context and assigns an UVBuffer index to the passed IMeshImp instance.
Declaration
public void SetUVs(IMeshImp mr, ReadOnlySpan<float2> uvs)
Parameters
| Type | Name | Description |
|---|---|---|
| IMeshImp | mr | The IMeshImp instance. |
| System.ReadOnlySpan<float2> | uvs | The UV's. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | UVs must not be null or empty |
| System.ApplicationException |
SetVertexArrayObject(IMeshImp)
Binds the VertexArrayObject onto the GL Render context and assigns its index to the passed IMeshImp instance.
Declaration
public void SetVertexArrayObject(IMeshImp mr)
Parameters
| Type | Name | Description |
|---|---|---|
| IMeshImp | mr | The IMeshImp instance. |
SetVertices(IMeshImp, ReadOnlySpan<float3>)
Binds the vertices onto the GL Render context and assigns an VertexBuffer index to the passed IMeshImp instance.
Declaration
public void SetVertices(IMeshImp mr, ReadOnlySpan<float3> vertices)
Parameters
| Type | Name | Description |
|---|---|---|
| IMeshImp | mr | The IMeshImp instance. |
| System.ReadOnlySpan<float3> | vertices | The vertices. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Vertices must not be null or empty |
| System.ApplicationException |
StorageBufferSetData<T>(IStorageBuffer, T[])
Uploads the given data to the SSBO. If the buffer is not created on the GPU by no it will be.
Declaration
public void StorageBufferSetData<T>(IStorageBuffer storageBuffer, T[] data)
where T : struct
Parameters
| Type | Name | Description |
|---|---|---|
| IStorageBuffer | storageBuffer | The Storage Buffer Object on the CPU. |
| T[] | data | The data that will be uploaded. |
Type Parameters
| Name | Description |
|---|---|
| T | The data type. |
UpdateTextureRegion(ITextureHandle, ITexture, Int32, Int32, Int32, Int32)
Updates a specific rectangle of a texture.
Declaration
public void UpdateTextureRegion(ITextureHandle tex, ITexture img, int startX, int startY, int width, int height)
Parameters
| Type | Name | Description |
|---|---|---|
| ITextureHandle | tex | The texture to which the ImageData is bound to. |
| ITexture | img | The ImageData struct containing information about the image. |
| System.Int32 | startX | The x-value of the upper left corner of th rectangle. |
| System.Int32 | startY | The y-value of the upper left corner of th rectangle. |
| System.Int32 | width | The width of the rectangle. |
| System.Int32 | height | The height of the rectangle. |
Remarks
///
Viewport(Int32, Int32, Int32, Int32)
Set the Viewport of the rendering output window by x,y position and width,height parameters. The Viewport is the portion of the final image window.
Declaration
public void Viewport(int x, int y, int width, int height)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | x | The x. |
| System.Int32 | y | The y. |
| System.Int32 | width | The width. |
| System.Int32 | height | The height. |