• 13
• 18
• 19
• 27
• 9

# [DX10] Simple State Questions

This topic is 3472 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, as you might know a DX10 technique in an effect file looks like this:
technique10 Technique1 {
pass P0 {

SetDepthStencilState(DSStateFoo, 0 );
//SetRasterizerState(RSFoo);
SetBlendState(BSFoo, float4(0.0f, 0.0f, 0.0f, 0.0f), 0xFFFFFFFF);
}
}


The three state objects (structures) DSStateFoo, RSFoo and BSFoo are defined at top of the HLSL file. My questions: 1) What happens if I dont set a state in the technique10 declaration? In this example I commented out the rasterizer state. Does this mean all rasterizer states used from previous render passes will be used? 2) What happens if I set a state in the effect file (for example BSFoo), which does not define all attribues. For example:
BlendState BSFoo {
BlendEnable[0] = FALSE;
};


BSFoo only defines BlendEnable[0] but all other blendstate variables are not set. What values will these variables have? Will the system take the previous values or will it set all undefined values to default values? 3) How should I manage my states? Should every technique ALWAYS set ALL state objects? Or should I only set a state if the technique requires a different attribute (isnt this really complicated because to do so I have to how the states look like if I start the technique?) 4) Should I set my states directly in the effect file (like in this example) or in the host application? Thanks!