Hi all, I am trying to create a custom inspector for an object similar to the one that comes with unity for materials / mesh’s.
Unity preview pane:
I have spent a few hours trying to throw something together that would work for this but I am coming up blank. My current test bed is an EditorWindow (as in I am trying to simply render a sphere with a material into an editor window).
I have tried a few methods
Handles.DrawCamera( new Rect( 0, 0, Screen.width, Screen.height), previewCamera );
Handles.ClearCamera( new Rect( 0, 0, Screen.width, Screen.height), previewCamera );
for( var i = 0; i < material.passCount; i++ )
{
material.SetPass( i );
Handles.SphereCap( 0, Vector3.zero, Quaternion.identity, 2.0f );
}
and I have also tried using ‘draw mesh’.
Does anyone have any idea of a way that I could achieve this effect?
After doing some more experimentation it seems like I need a way to render an arbitrary mesh illuminated by an arbitrary array of lights to a texture / render texture. I don’t think there are any currently exposed ways to do this without massive hackery.