new DeferredSasEffect(); has no public constructor

rated by 0 users
This post has 3 Replies | 2 Followers

Top 25 Contributor
Posts 233
SunBurn_Community_Licensee
SunBurn_Pro_Licensee
2.0 Studios Posted: 06-10-2012 4:48 AM

Hey I am trying to load a shader on the fly and have found that new DeferredSasEffect(); has no public constructor, which makes it impossible to do as far as I can tell...

I have over 20 shaders in the rest of the game that load on demand (for a bunch of different reasons..) and I really need to be able to load sunburn ones "DeferredSasEffect" on the fly and not though the content manager.

Any ideas?

Top 10 Contributor
Posts 5,378
Employee
SunBurn_Studio_Licensee

Hi 2.0,

Xna 4 doesn't provide a way to create effects at runtime from shader code, because of this SunBurn's sas effects do not have a public constructor (otherwise the created effect would contain no shader).

Let me know if this helps!

Follow me on Twitter – development and personal tweets
Awesome XNA Videos – Lighting, Rendering, and game videos

Top 25 Contributor
Posts 233
SunBurn_Community_Licensee
SunBurn_Pro_Licensee

Actually I load and create about 30 shaders from .hlsl files during runtime to support on the fly shader editing the only ones I cannot create are the sunburn ones...

It would be cool if I could do this for sunburn effects too :)

 

Also how can I tint a model in sunburn without cloning the effect and applying it to each model? I found I can use a custom lighting mode and set a custom color but this fails to work in my custom shader (most likely because I need to sample from a extra color variable?) what will I need to do in order to get this to work?

 

Thanks!

Top 10 Contributor
Posts 5,378
Employee
SunBurn_Studio_Licensee

Hi 2.0,

Are you running shaders through the XNA content pipeline (dynamically in-game)?  The biggest problem with this approach is the pipeline assemblies are not available in the XNA redistributable (the version used by gamers / end-users).

I posted custom effect details in your other thread.

Let me know if this helps!

Follow me on Twitter – development and personal tweets
Awesome XNA Videos – Lighting, Rendering, and game videos

Page 1 of 1 (4 items) | RSS