DirectX9Effect
Description
- Derived from
-
RenderEffect<TParameters> abstract
- Extended by
-
Example_DirectX9Effect sealed
Full source code is included in the Tinman 3D SDK download. |
Abstract base class for Direct3D 9 IRenderEffect implementations.
An implementing class must perform the following steps in its constructor:
-
Create render effect passes with RenderEffect.PassCreate.
-
Create shader objects with RenderEffect.ShaderCreate and assign them to render effect passes with RenderEffect.ShaderAssign.
If an implementation wants to use low-level parameter slots, the following steps must be performed in the constructor:
-
Declare low-level parameter slots with IRenderEffectParameters.ParameterDeclare, for example by calling RenderEffectParameters.Declare.
The RS_SRGBWRITEENABLE
render state is set automatically according to the RenderTargetFormat.Srgb format flags of render targets that have been set via IGraphicsContext.SetRenderTarget.
The SAMP_SRGBTEXTURE
sampler state is set automatically according to ITexture.IsSrgb when a texture is set via IRenderEffectParameters.ParameterTexture1 or IRenderEffectParameters.ParameterTexture2.
Public / Methods
RenderStateApply
Helper method for applying default render states.
-
RS_ALPHATESTENABLE =
true
-
RS_ALPHAREF =
1.0f
-
RenderStateAlphaToCoverage =
true
-
RS_ANTIALIASEDLINEENABLE =
true
-
RS_MULTISAMPLEANTIALIAS =
true
-
RS_ZWRITEENABLE =
false
RenderStateDefault
Sets default render state values.
These are the default render state values; (!)
means that the value differs from the standard value that is defined by Direct3D:
RS_ALPHABLENDENABLE = false
RS_ALPHAFUNC = CMP_ALWAYS
RS_ALPHAREF = 0
RS_ALPHATESTENABLE = false
RS_ANTIALIASEDLINEENABLE = false
RS_BLENDFACTOR = ~0
RS_BLENDOP = BLENDOP_ADD
RS_BLENDOPALPHA = BLENDOP_ADD
RS_CCW_STENCILFAIL = STENCILOP_KEEP
RS_CCW_STENCILFUNC = CMP_ALWAYS
RS_CCW_STENCILPASS = STENCILOP_KEEP
RS_CCW_STENCILZFAIL = STENCILOP_KEEP
RS_CLIPPLANEENABLE = 0
RS_COLORWRITEENABLE = 0xF
RS_COLORWRITEENABLE1 = 0xF
RS_COLORWRITEENABLE2 = 0xF
RS_COLORWRITEENABLE3 = 0xF
RS_CULLMODE = CULL_CCW
RS_DEPTHBIAS = 0.0f
RS_DESTBLEND = BLEND_ZERO
RS_DESTBLENDALPHA = BLEND_ZERO
RS_DITHERENABLE = false
RS_FILLMODE = FILL_SOLID
RS_INDEXEDVERTEXBLENDENABLE = false
RS_LASTPIXEL = false (!)
RS_MULTISAMPLEANTIALIAS = false (!)
RS_MULTISAMPLEMASK = ~0
RS_NORMALIZENORMALS = false
RS_POINTSCALE_A = 1.0f
RS_POINTSCALE_B = 0.0f
RS_POINTSCALE_C = 0.0f
RS_POINTSCALEENABLE = false
RS_POINTSIZE_MAX = 64.0f
RS_POINTSIZE_MIN = 1.0f
RS_POINTSPRITEENABLE = false
RS_SCISSORTESTENABLE = false
RS_SEPARATEALPHABLENDENABLE = false
RS_SLOPESCALEDEPTHBIAS = 0.0f
RS_SRCBLEND = BLEND_ONE
RS_SRCBLENDALPHA = BLEND_ONE
RS_STENCILENABLE = false
RS_STENCILFAIL = STENCILOP_KEEP
RS_STENCILFUNC = CMP_ALWAYS
RS_STENCILMASK = ~0
RS_STENCILPASS = STENCILOP_KEEP
RS_STENCILREF = 0
RS_STENCILWRITEMASK = ~0
RS_STENCILZFAIL = STENCILOP_KEEP
RS_TWEENFACTOR = 0.0f
RS_TWOSIDEDSTENCILMODE = false
RS_VERTEXBLEND = 0
RS_ZENABLE = true
RS_ZFUNC = CMP_LESSEQUAL
RS_ZWRITEENABLE = true
These are the default sampler state values:
SAMP_ADDRESSU = TADDRESS_WRAP
SAMP_ADDRESSV = TADDRESS_WRAP
SAMP_ADDRESSW = TADDRESS_WRAP
SAMP_BORDERCOLOR = 0
SAMP_MAGFILTER = TEXF_POINT
SAMP_MINFILTER = TEXF_POINT
SAMP_MIPFILTER = TEXF_NONE
SAMP_MIPMAPLODBIAS = 0.0f
SAMP_MAXMIPLEVEL = 0
SAMP_MAXANISOTROPY = 1
SAMP_ELEMENTINDEX = 0
SAMP_DMAPOFFSET = 0.0f
These are the default non-standard render state values:
RenderStateAlphaToCoverage = false
RenderStateSet
Sets the render state for the given rendering stage.
- See also
-
IRenderEffectBase.PassCurrent
DirectX9Effect.RenderStateAlphaToCoverage
DirectX9Effect.RenderStateApply
DirectX9Effect.RenderStateBool
DirectX9Effect.RenderStateDefault
DirectX9Effect.RenderStateFloat
DirectX9Effect.RenderStateInt
DirectX9Effect.SamplerStateApply
DirectX9Effect.SamplerStateFloat
DirectX9Effect.SamplerStateInt
DirectX9Effect.TextureStage
DirectX9Effect.TextureStages
SamplerStateApply
Helper method for applying default sampler states to all texture stages that are bound to the given parameter slot.
Default sampler states:
SetParameters
Applies the current values of all changed effect parameters (see RenderEffectParameters.Changed2).
The default implementation calls RenderEffectParameters.Apply on IRenderEffect.Parameters.
SetPixelShaderConstantFloat
Sets a pixel shader constant.
This method writes to one or more constant float registers (c?).
SetTexture
2 overloads
Sets the texture of the given texture stage.
The SAMP_SRGBTEXTURE
sampler state is set automatically according to ITexture.IsSrgb
Sets the texture of the given texture stage.
The SAMP_SRGBTEXTURE
sampler state is set automatically according to ITexture.IsSrgb
SetVertexShaderConstantFloat
Sets a vertex shader constant.
This method writes to one or more constant float registers (c?).