memononen / nanovg

Antialiased 2D vector drawing library on top of OpenGL for UI and visualizations.
zlib License
5.16k stars 774 forks source link

Integrating into existing OGL 4.5 project. #363

Open Necrolis opened 7 years ago

Necrolis commented 7 years ago

I have a very strange issue using NanoVG (via Oui-Blendish); If I render the UI first, and then my world, everything renders correctly. However if I render my world first and my UI on top, the UI renders and the world is completely black. I'm using SDL2 with OGL 4.5 as the rendering driver.

I've spent a good amount of time checking if any of the open issues seem to solve my problem (basically checking state/uniforms aren't stomped), but so far nothing has helped. I would like to understand what is going on here (theoretically if you render the UI first with the depth buffer on, it should save rendering cycles if it is opaque as the world behind it should fail the z-test..).

lieff commented 7 years ago

Probably your world render uses stencil buffer, which used also by nanovg.