Material.Renderer

Nov 3, 2010 at 6:29 PM

Hi,

I see that there is a property in Material called Renderer.  The material chooses the correct triangle renderer depending on the various settings of the material.  Can the set be exposed publicly so one could swap out the renderer with a new version?  I see that triangle is public, so I can create my own.  But I'm not sure how to get that into the material.  Is there another way to be doing this other than setting the Material.Renderer property directly?

Perhaps even better the method SetRenderer could call a protected virtual method called GetRenderer.  The base function would work the same as SetRenderer does not, but we could inherit from material to change the way this works.

Just a thought.

Coordinator
Nov 3, 2010 at 7:35 PM
And a good thought it is. I've been wanting to make it possible to make your own shader like functionality. But I guess opening this up a bit would be possible as well. I think an approach were you'd inherit from Material and a model with a protected virtual method one could override to get the renderer would be the preferred way.
Coordinator
Nov 3, 2010 at 7:37 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.