Let's say I have a material. We'll call it mat_mymat. It's defined so it has no "effect", but later I load one using effect_load(mat_mymat,"myshader.fx").

All is well and good, and it works, but lets say I want to remove it. Can this be done?

My choices so far seem to be to either:

1.) Create a second material, with the shader, and simply swap them out, but If i have many entities using the same material, id have to keep a list, and swap them all out.

2.) Create a shader that "does nothing". Simply copies the input values to the output values, or something to that effect.

Since I've tried effect_load(mat_mymat,null) and effect_load(mat_mymat,"") and neither work, (and neither does using mat_mymat.effect = "" or mat_mymat.effect = null)

One thing I havent tried, is to create another material w.o an effect and simply do an effect assignnment, ie. mat_mymat.effect = mat_mymat_ns.effect, where mat_mymat_ns is a material w/o a shader.

Anyone have any suggestions?


Never argue with an idiot. They drag you down to their level then beat you with experience