XNA Creators Club Online
Page 1 of 1 (3 items)
Sort Posts: Previous Next

Effect pools and contant buffers

Last post 3/28/2009 2:19 AM by aik6980. 2 replies.
  • 3/26/2009 12:00 PM

    Effect pools and contant buffers

    Im wondering what is best sollution and how some parts exactly work.

    Lets take for example a game project with different effect file.
    Now each effect has some standard parameters like world/view/projection matrices, time variable.


    What i had in mind, was making an effect pool using a shared constant buffer containing these values so i only have to update them once for each used effect.

    now the question ... how will this affect performance and is it really needed?

    Would this be possible instead?
    u set the matrices on the first effect, each effect file use exact same name for constant buffer and parameter names. If i set these values on the first effect, will the other effect still know these values or must they be set separatly for each effect?
  • 3/26/2009 2:08 PM In reply to

    Re: Effect pools and contant buffers

    Nightmare:

    now the question ... how will this affect performance and is it really needed?


    Effect pools are supposed to give better performance if used correctly. I tried once to get them working, but was using a HLSL include, which for some reason didn't work as expected. I gave up pretty quickly.

    Nightmare:
    u set the matrices on the first effect, each effect file use exact same name for constant buffer and parameter names. If i set these values on the first effect, will the other effect still know these values or must they be set separatly for each effect?


    As far as I know, when you begin an effect you are always sending your effect parameter values across to the card. I could be wrong. If you could do this, you would likely end up at the mercy of driver implementations anyway. It's almost better to know definitely what is going to happen always, even if that means a slight performance overhead.
  • 3/28/2009 2:19 AM In reply to

    Re: Effect pools and contant buffers

    using effect pool will help improving the performance indeed.
    I have my performance project that render more than 300k scene objects including particles animations

    Effect pool helps me a lot, for example camera information, frame time and etc. all stuff that you want to share among entities

    Answering your question,
    Effect will not share their buffer unless it compile using CHILD_FLAG, so even you have the same cBuffer I will not use the one you have set before and this is where it become expensive.

    I believe I have a bit of topic about directx effectpool on my website, (hmm, not quite sure)
    Please MS, please include an simple and stable animated meshes loader into DirectX10

    NVPerfHUD has a problem with ID3DEffectPool?
    http://developer.nvidia.com/forums/index.php?showtopic=2784
Page 1 of 1 (3 items) Previous Next
var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG