Puddinglord
Puddinglord

Reputation: 133

OpenGL lines in Unity, draw once but show forever?

Right now in my unity project I am drawing OpenGL lines similar to the way drawRay() works in Unity. I have been trying to make it so that once the lines are rendered/drawn they stop redrawing themselves so that I can save on performance.

Is there a way to only draw an OpenGL line once in the OnPostRender() function but have it continually stay drawn in the unity scene as if it were a static image now?

Upvotes: 2

Views: 465

Answers (1)

You can't do this

If you want things to persist, then they need to be drawn. You can't have your cake (visible polygons) and eat it too (not draw them).

The only way to save on performance is to batch things together into larger blocks of drawable polygons and draw them all at once in one go.

Upvotes: 1

Related Questions