Sign in to follow this  
vidalsasoon

using the EffectPool

Recommended Posts

vidalsasoon    100
hi, i'm creating my effects like this: EffectPool effectpool; effect = Effect.FromFile(dev, Global.settings.InstallPath + @"resources\" + effectMaterial.FXFile, null, null, ShaderFlags.None, effectpool, out errors); Each material on my mesh creates an effect. i.e. I would like to set the world matrix on my mesh once and not for each material... this is not working. Any idea what i'm doing wrong? BTW, I found it odd that to use the effectpool we had a declare a variable for it. I was assuming we would just set the parameter to "true" to enable shared params. Maybe this is a source of my problems. V.

Share this post


Link to post
Share on other sites
vidalsasoon    100
actually, I had done this. just forgot to put it.

EffectPool effectpool = new EffectPool();

...

effect = Effect.FromFile(dev, Global.settings.InstallPath + @"resources\" + effectMaterial.FXFile, null, null, ShaderFlags.None, effectpool, out errors);


edit: Basically, I don't understand what the effectpool object is used for besides internally on the video card.


I have 2 effect files. Both use "ViewI". Setting ViewInverse on one variable does not set it on the second effect...

Share this post


Link to post
Share on other sites
Nik02    4348
The effect pool will automatically share the parameters with same name, type and semantic across multiple effects. You could use a common include file which declares all the global effect variables, and include it to every effect file.

You can also create a dummy effect if you want, though. It's a matter of preference, mostly.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this