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?
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 tweetsAwesome XNA Videos – Lighting, Rendering, and game videos
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!
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.