Click or drag to resize
Ab4d.SharpEngine logo

ShadersManagerGetShaderBytes Method

Gets bytes array of the shader byte code. Before using this method, the shader resources need to be registered with RegisterShaderResource(ShaderBytecodeProvider) method.

Namespace: Ab4d.SharpEngine.Utilities
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
Syntax
C#
public byte[]? GetShaderBytes(
	string resourceName,
	bool throwExceptionIfNotFound = false
)

Parameters

resourceName  String
shader resource name
throwExceptionIfNotFound  Boolean  (Optional)
if true than exception will be thrown when resourceName is not found; when false null is returned in this case

Return Value

Byte
bytes array of the shader byte code
Remarks

Gets bytes array of the shader byte code. Before using this method, the shader resources need to be registered with RegisterShaderResource(ShaderBytecodeProvider) method.

EffectsManager by default registers the Ab4d.SharpEngine assembly as an AssemblyShaderBytecodeProvider that can provide many shaders stored as embedded resources in Ab4d.SharpEngine assembly.

You can register custom shader resources by creating your own instances of AssemblyShaderBytecodeProvider, FileShaderBytecodeProvider or DirectoryShaderBytecodeProvider or any other class that is derived from ShaderBytecodeProvider.

See Also