简体   繁体   English

OpenGL ES 如何在前一帧的顶部绘制

[英]OpenGL ES How to draw on top of previous frame

I want to be able to draw on top of the previous frame to track the motion of a particle.我希望能够在前一帧之上绘制以跟踪粒子的运动。 First I tried not calling glClear() and this works on the iPad simulator, but produces a flickering affect on the actual device.首先,我尝试不调用 glClear(),这适用于 iPad 模拟器,但会在实际设备上产生闪烁效果。 There are 4000 particles to draw so drawing more each frame isn't an option for performance reasons.有 4000 个粒子要绘制,因此出于性能原因,每帧绘制更多不是一个选项。 Is there some way to execute the current drawing commands on top of the previous frame.是否有某种方法可以在前一帧之上执行当前绘图命令。 Something like combining the current buffer with the previous?类似于将当前缓冲区与前一个缓冲区结合起来?

Thanks!谢谢!

It is generally a good idea to draw everything every frame (at least if using double buffering).每帧绘制所有内容通常是一个好主意(至少在使用双缓冲的情况下)。 What you can do is draw the scene into a texture (using FBOs) incrementally (without glClear ) and then just display this texture every frame.您可以做的是逐步将场景绘制到纹理中(使用 FBO)(不使用glClear ),然后每帧都显示此纹理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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