Search Unity

GL.Wireframe questions

Discussion in 'Scripting' started by Staples, Sep 4, 2013.

  1. Staples

    Staples

    Joined:
    Jan 14, 2009
    Posts:
    224
    Hi all,

    I've tried out GL.wireframe and it seems quite nice. Does anyone know what devices it won't work on? Will it work with DirectX9+?

    Also the documentation says you can turn this on in OnPreRender, and off in OnPostRender, however I was trying to use it in OnRenderObject, but unfortunately there is no OnPostRenderObject and OnPostRender only fires when attached to a camera.

    So how would I use this with a single object on the scene and not effect all of the objects? I tried the following which at least stopped wireframe mode from effecting the GUI, but it still effected all objects since OnWillRenderObject functions are called before any OnRenderObject functions.

    Code (csharp):
    1.  void OnWillRenderObject ()
    2.     {
    3.         GL.wireframe = true;
    4.     }
    5.    
    6.     void OnRenderObject()
    7.     {
    8.         GL.wireframe = false;
    9.     }
    Any suggestions?