Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualNightCreature83

Posted 04 January 2013 - 06:05 PM

You need to do a begin on the effect first anyway, after that you only want to render pass one of the technique you specify, right? In any case after begin on the effect you need to do a BeginPass anyway to render with a pass in that active technique, read the remarks on both documentation pages.

Generally rendering with D3DXEffect looks like this
unsigned int numberOfPassInActiveEffect = 0;
m_effect->Begin(&numberOfPassInActiveEffect); //This sets the variable to the number of passes this technique has
for (unsigned int counter = 0; counter < numberOfPassInActiveEffect; ++counter)
{
    m_effect->BeginPass(counter);
    //Do pass specific passing of uniforms here
    m_effect->CommitChanges();
    //Do render calls here
    m_effect->EndPass();
}
m_effect->End();

If you only want to render one pass in the current effect instead of looping on all available passes, just activate the pass you are interested in with ID3DXEffect::BeginPass(unsigned int passNumber), and do your rendering.

#1NightCreature83

Posted 04 January 2013 - 06:05 PM

You need to do a begin on the effect first anyway, after that you only want to render pass one of the technique you specify, right? In any case after begin on the effect you need to do a BeginPass anyway to render with a pass in that active technique, read the remarks on both documentation pages.<br /><br />Generally rendering with D3DXEffect looks like this<pre class="_prettyXprint _lang-code _linenums:NaN">
unsigned int numberOfPassInActiveEffect = 0;
m_effect-&gt;Begin(&amp;numberOfPassInActiveEffect); //This sets the variable to the number of passes this technique has
for (unsigned int counter = 0; counter &lt; numberOfPassInActiveEffect; ++counter)
{
m_effect-&gt;BeginPass(counter);
//Do pass specific passing of uniforms here
m_effect-&gt;CommitChanges();
//Do render calls here
m_effect-&gt;EndPass();
}
m_effect-&gt;End();
</pre><br />If you only want to render one pass in the current effect instead of looping on all available passes, just activate the pass you are interested in with ID3DXEffect::BeginPass(unsigned int passNumber), and do your rendering.

PARTNERS