Click or drag to resize
AB4D logo

PixelEffect Class

PixelEffect is an effect that is using geometry shader to create and render many pixels (small rectangles) in 3D world.
Inheritance Hierarchy
SystemObject
  Ab3d.DirectXDXResourceBase
    Ab3d.DirectXSharedDXResource
      Ab3d.DirectXSharedDXDeviceResource
        Ab3d.DirectXEffect
          Ab3d.DirectX.EffectsPixelEffect

Namespace: Ab3d.DirectX.Effects
Assembly: Ab3d.DXEngine (in Ab3d.DXEngine.dll) Version: 7.0.8865.1045
Syntax
C#
public class PixelEffect : Effect

The PixelEffect type exposes the following members.

Constructors
 NameDescription
Public methodPixelEffect Constructor
Top
Properties
 NameDescription
Public propertyIsCircularPixel Gets or sets a Boolean value that specifies if pixels are rendered as circle instead of square. This value is used when the object does not provide a PixelMaterial. Default value is false.
Public propertyIsWorldSize Gets or sets a Boolean value that specifies if pixel size is specified in 3D world coordinates (true) or in screen coordinates (false). This value is used when the object does not provide a PixelMaterial. Default value is false.
Public propertyOverridePixelColor Gets or sets a Boolean that specifies if PixelColor is used regardless of the color defined in the material.
Public propertyPixelColor Gets or sets a Color4 value that specifies the color of the pixel that is used when the color is not specified by the material.
Public propertyPixelSize Gets or sets a float value that specifies the size of the pixel that is used when the size is not specified by the material.
Public propertyRequiredInputLayoutType Gets the input layout that is required to render this effect.
(Overrides EffectRequiredInputLayoutType)
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)
Public methodRemoveTexture Removes the texture that was set by calling SetTexture method.
Public methodResetFixedUpVector Resets the fixed up vector that was set by SetFixedUpVector(Vector3) to default behaviour (pixels always face the camera so that their up vector is perpendicular to the look direction).
Public methodSetFixedUpVector SetFixedUpVector sets a fixed up Vector3 to be always used for up vector when orienting pixel towards the camera. By default, pixels always face the camera so that their up vector is perpendicular to the look direction. But for some cases (for example for rendering trees that always grow upwards), you can fix the up vector. To reset that up vector to default behaviour, call ResetFixedUpVector. Fixed up vector can be used only when IsWorldSize is set to true.
Public methodSetTexture(ShaderResourceView, Size2, SamplerState, BlendState) SetTexture method sets the specified texture to be rendered for each pixel. This value is used when the object does not provide a PixelMaterial. When rendering texture, AlphaClipThreshold is set to 0.5 (pixel with alpha color values below this value will be clipped). To remove the texture, set the pixelTexture to null or call RemoveTexture.
Public methodSetTexture(ShaderResourceView, Size2, Color4, SamplerState, BlendState) SetTexture method sets the specified texture to be rendered for each pixel. This value is used when the object does not provide a PixelMaterial. This also sets the PixelColor to colorMask and OverridePixelColor to true (when pixelTexture is not null). When rendering texture, AlphaClipThreshold is set to 0.5 (pixel with alpha color values below this value will be clipped). To remove the texture, set the pixelTexture to null or call RemoveTexture.
Top
Fields
 NameDescription
Public fieldStatic memberEffectName EffectName
Top
Remarks

PixelEffect is an effect that is using geometry shader to create and render many pixels (small rectangles) in 3D world.

When PixelEffect is used to render objects that do not have PixelMaterial, then the properties in this effect define the pixel size (PixelSize, IsWorldSize) and shape of the pixels (IsCircularPixel).

When the material implements IPixelMaterial or IDiffuseMaterial, then the color of the pixels is read from the material. This can be overridden by setting OverridePixelColor to true. Then PixelColor is used for all pixels.

To use PixelEffect to render textures (billboards), call SetTexture(ShaderResourceView, Size2, Color4, SamplerState, BlendState) or SetTexture(ShaderResourceView, Size2, SamplerState, BlendState).

See Also