Sign in to follow this  

How to implement a material system under changing environment

This topic is 4204 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 4204 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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