Click or drag to resize
AB4D logo

SolidColorEffect Class

SolidColorEffect is an effect that renders the mesh geometry with specified color that is not affected (changed) by the lights in the scene. This effect can also expand the rendered objects in the direction of the normal to create an outline effect. The effect can be applied a standard 3D geometry, to 3D line(s) and to instanced objects.
Inheritance Hierarchy
SystemObject
  Ab3d.DirectXDXResourceBase
    Ab3d.DirectXSharedDXResource
      Ab3d.DirectXSharedDXDeviceResource
        Ab3d.DirectXEffect
          Ab3d.DirectX.EffectsSolidColorEffect

Namespace: Ab3d.DirectX.Effects
Assembly: Ab3d.DXEngine (in Ab3d.DXEngine.dll) Version: 7.1.9105.2048 (1.0.0.0)
Syntax
C#
public class SolidColorEffect : Effect

The SolidColorEffect type exposes the following members.

Constructors
 NameDescription
Public methodSolidColorEffect Constructor
Top
Properties
 NameDescription
Public propertyAddAmbientColor When true then ambient light color is added to the color. False by default.
Public propertyColor Gets or sets a Color4 that is used to render all 3D models when OverrideModelColor property is set to true.
Public propertyDepthBias A DepthBias is a value that specifies how much the line is moved closer to the camera. The value is specified in world coordinates. Default value is 0.
Public propertyOutlineThickness Gets or sets a float that specifies the thickness of the outline that is created with expanding the objects in the direction of the normal. The value is specified in screen-space units. Default value is 0 that does not produce any outline.
Public propertyOverrideBlendState When OverrideBlendState is set then SolidColorEffect will use that blend state. When null (by default) then Opaque blend state is used when Alpha is 1, and PremultipliedAlphaBlend is used when Alpha is less then 1 (in this case the color components are also multiplied with alpha value to produce pre-multiplied colors).
Public propertyOverrideModelColor When true then the Color is used to render all the 3D models. When false (by default) the color defined in the model's material is used.
Public propertyOverrideRasterizerState When OverrideRasterizerState is set then SolidColorEffect will use this rasterizer state, for example to disable object culling use CullNone. When null (by default) then back-face or front-face culling is used based on the geometry and material.
Public propertyPremultiplyAlphaColors When PremultiplyAlphaColors is true (by default) and Alpha is less then 1, then the color components are also multiplied with alpha value to produce pre-multiplied colors.
Public propertyRequiredInputLayoutType Gets the input layout that is required to render this effect.
(Overrides EffectRequiredInputLayoutType)
Public propertyWriteMaxDepthValue When true then the models are rendered to the back of the scene so that all other rendered objects will be rendered before them. This can be used to outline all selected objects without rendering selection lines between them. When false (by default) the models are rendered to their correct depth.
Top
Methods
 NameDescription
Public methodApplyMaterial Applies the material and object's world matrix to this effect.
(Overrides EffectApplyMaterial(Material, RenderablePrimitiveBase))
Public methodPreloadShaders PreloadShaders can be called to load the shaders in advance before they are used. Calling this method increases the startup time, but when the 3D object needs to be shown, it is shown faster because all the shaders have already been created.
(Overrides EffectPreloadShaders)
Top
Fields
 NameDescription
Public fieldStatic memberEffectName Effect name
Top
See Also