D3DXCreateEffectFromFile
or only one effect with three techinque inside ??? And in the last case (one effect with three techinque), when I use:
SetTechnique
I overwrite the technique when re-use "SetTechnique" or not ???
Thanks for all.
D3DXCreateEffectFromFile
SetTechnique
Quote:Original post by Namethatnobodyelsetook
You'll make 1 ID3DXEffect object that has all 3 techniques in it.
SetTechnique is used to choose which technique the next draw will use. If these techniques use the same variables, the ID3DXEffect system will make sure the variable contains the last set value, even if it was set when using a different technique.
Quote:Original post by Namethatnobodyelsetook
You'll make 1 ID3DXEffect object that has all 3 techniques in it.
Quote:Original post by Namethatnobodyelsetook
If you have 1 FX file, with 3 techniques that share a variable, and you do:
SetTechnique(A)
SetFloat(sharedVarHandle, 1.0f);
SetTechnique(B)
SetFloat(sharedVarHandle, 2.0f);
SetTechnique(C)
SetFloat(sharedVarHandle, 3.0f);
then the shared variable will have the value of 3.0f in all 3 techniques...
Quote:Original post by Namethatnobodyelsetook
You can make 3 seperate effect objects, though the overhead of changing shaders is far larger than the overhead of changing a variable and using the same shader.
1 - CreateEffectFromFile in the initializzation of the application1.1 - effect->GetTechnique(...)1.2 - GetParameter ByName(...)1.3 - m_technique=effect->SetTechnique(...)2 - in the phase of rendering the 3D scene:2.1 - effect->Begin(NULL, 0)2.2 - effect->SetValue(shareVariable, valoreVector)2.3 - effect->BeginPass(0) // I have "pass single" in each technique2.4 - effect->CommitChanges()2.5 - effect->EndPass()2.6 - effect->End()2.7 - rendering of the 3D scene
1 - CreateEffectFromFile in the initializzation of the application1.1 - effect->GetTechnique(...)1.2 - GetParameter ByName(...)1.3 - m_technique=effect->SetTechnique(...)2 - in the phase of rendering the 3D scene:2.1 - effect->Begin(NULL, 0)2.2 - effect->SetValue(shareVariable, valoreVector)2.3 - effect->BeginPass(0) // I have "pass single" in each technique2.4 - effect->CommitChanges()2.5 - rendering of the 3D scene (Clear, BeginScene, render, EndScene, Present)2.6 - effect->EndPass()2.7 - effect->End()
D3DX: ID3DXEffect::ApplyParameterBlock: Failed
Quote:If I use only one effect with three technique, as in the code you have written, I set the share variable for the techinque A to 1.0f, B to 2.0f and C to 3.0f and not A, B and C to 3.0f ???