简体   繁体   中英

How to draw GL premitives behind GameObject in Unity3d

I have a question that I can't find in a documentation. I use GL premitives to draw grid. But I can't understand how to push it behind gameObjects. Now grid is drawing on main Camera in OnRenderObject, and as result I see grid in front of gameObjects. If I draw it in Update or LateUpdate the grid is visible only in Scene mode. So, please, tell me what options do I have?

Looking over the documentation ...

I see...

  • OnPreRender - OnPreRender is called before a camera starts rendering the scene.
  • OnWillRenderObject - OnWillRenderObject is called for each camera if the object is visible and not a UI element.

Both of these fire before anything renders. Whereas the method you're using now has this description:

OnRenderObject is called after camera has rendered the scene.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM