Drawing many spheres in OpenGL

僤鯓⒐⒋嵵緔 提交于 2019-11-30 00:57:24
Gregory Pakosz

Have a look at this page on instancing: it contains many references:

See also Geometry instancing on Wikipedia.

If you draw ~100k spheres, you might want to consider raycasting them instead of using polygon meshes to approximate them. The papers GPU-Based Ray-Casting of Quadratic Surfaces by Sigg et al. (2006) and Splatting Illuminated Ellipsoids with Depth Correction by Gumhold (2003) show how to do this. If you do this, you can reuse much of your fast point sprite code.

You could use point sprites and a fragment shader to duplicate the effect of a rendered sphere without the actual sphere geometry. I would try instancing first, however.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!