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: 3.1.9316+94bbd23b55747f096f056a5602f7dd90558b3673
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