Click or drag to resize
Ab4d.SharpEngine logo

EffectsManager Class

EffectsManager class help use the Effect classes. It provides loading, caching and reusing the effects and shaders. All access to effects and shaders is thread safe.
Inheritance Hierarchy
SystemObject
  Ab4d.SharpEngine.CoreComponentBase
    Ab4d.SharpEngine.CoreSceneComponent
      Ab4d.SharpEngine.UtilitiesEffectsManager

Namespace: Ab4d.SharpEngine.Utilities
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
Syntax
C#
public class EffectsManager : SceneComponent

The EffectsManager type exposes the following members.

Properties
 NameDescription
Public propertyEffects Gets a readonly collection of all registered effects
Public propertyEffectsCount Gets a number of registered effects
Public propertyIsCustomStandardEffect Gets a Boolean that specifies if a custom standard effect was registered.
Public propertyIsYAxisUpInClipSpace When true (by default), we perform y-inversion of the clip-space to framebuffer-space transform (invert y value in normalized device coordinates - NDC)
Top
Methods
 NameDescription
Public methodCleanup Cleanup method removes the removed effects
Public methodStatic memberCreate Creates the EffectsManager.
Public methodCreateNewT Creates a new effect of the specified effect type and with the specified name (must be unique). The methods returns the created Effect and a DisposeToken that can be used to dispose the effect.
Protected methodDispose Releases unmanaged and managed resources (when disposing is true). This method may be called only from the CheckAndDispose(Boolean) method and must not be called manually by the user.
(Overrides ComponentBaseDispose(Boolean))
Public methodGetT Returns the effect with the specified effect name and type. When not found, then null is returned.
Public methodGetDefaultT Gets the default effect for the specified effect type (for example StandardEffect, ThickLineEffect, SolidColorEffect). If the default effect for the specified effect is not found, then it is created and returned.
Public methodGetStandardEffect Gets a StandardEffect that can render many different lights and all standard materials.
Protected methodOnEffectRegistered OnEffectRegistered
Protected methodOnInitializeDeviceResources Initializes resources with the specified GpuDevice. This method can be override and is called from InitializeDeviceResources method.
(Overrides SceneComponentOnInitializeDeviceResources(VulkanDevice))
Public methodRegisterEffect Registers the effect with EffectManager. Each used effect must be registered before it can be used in the rendering (without registering effect, its BeginUpdate and EndUpdate methods are not called). Registering effect will also initialize it (called OnInitializeDeviceResources) if the effect was not initialized yet.
Public methodRemoveRegisteredEffect Removes the effect that was created (or registered) by this EffectManager.
Public methodSetStandardEffect Sets a new custom Effect as a StandardEffect. StandardEffect should be able to render many different lights and all standard materials. If newStandardEffect is not yet registered by EffectsManager then this method also registers the newStandardEffect. If newStandardEffect is null the default StandardEffect will be set as a StandardEffect.
Top
Events
 NameDescription
Public eventEffectRegistered EffectRegistered event is fired when a new effect is registered
Top
See Also