   How to implement a material system under changing environment
  Hi all:  I've read a couple of times of the famous "material system implementation" thread involving Yann L and some other knowledgeable people. But in the thread, only material under static environment is discussed, what if the environment is changing, and requiring the material also changes accordingly? For example, a ghost may appears transparent when it's hiding away from the enemy, and appears solid when it's attacking. It may also casts shadow under some circumstances and doesn't cast any shadows under other circumstances.How do you manage such change in your engine? Do you choose not to allow such change from happening in the first place, or do you write different shaders for different environment, and let the engine decide which one to use at runtime? Or there're other better/more advanced technique, like real-time shader composition/compilation? I'd like to hear advices from you guys.   
Quote:Original post by 991060...There were several addons for the famous Material thread, with discussions about shader attunement to the scene graph. Just don't want to start that again.One approach is to define shader family, based on the needs of the renderer - shadowmapping, number of lights, different fog types, opacity, etc.Then, having all corresponding shaders combined into single material, and SG would choose appropriate shader from that material, based on the enviromental needs extracted from SG.;  thanks, I'll see what I can find from the records.   