Pixel |
public class PixelEffect : Effect
The PixelEffect type exposes the following members.
Name | Description | |
---|---|---|
PixelEffect | Constructor |
Name | Description | |
---|---|---|
IsCircularPixel | 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. | |
IsWorldSize | 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. | |
OverridePixelColor | Gets or sets a Boolean that specifies if PixelColor is used regardless of the color defined in the material. | |
PixelColor | 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. Default value is (0, 0, 0, 0). | |
PixelSize | 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. | |
RequiredInputLayoutType |
Gets the input layout that is required to render this effect.
(Overrides EffectRequiredInputLayoutType) | |
UseVertexIdColor | Gets or sets a Boolean value that specifies if pixel color is defined by the index of the pixel. When true, then the color defined in PixelColor is added to the color calculated from index of the pixel. See remarks for more info about how the index is written to color. Default value is false. |
Name | Description | |
---|---|---|
ApplyMaterial |
Applies the material and object's world matrix to this effect.
(Overrides EffectApplyMaterial(Material, RenderablePrimitiveBase)) | |
PreloadShaders |
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) | |
RemoveTexture | Removes the texture that was set by calling SetTexture method. | |
ResetFixedUpVector | 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). | |
SetFixedUpVector | 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. | |
SetTexture(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. | |
SetTexture(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 and when UseVertexIdColor is false). 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. |
Name | Description | |
---|---|---|
EffectName | EffectName |
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).