重绘旧缓冲区问题
我的主场景由 3D 空间中的 GL_POINTS 组成。我想做的是,当用户在屏幕上移动手指时,能够在场景顶部绘制一条 GL_LINES 线(2d 覆盖),同时保留底层 3D GL_POINTS 状态。我无法理解这是否可能。我需要 2 个帧缓冲区吗?如何保存 GL_POINTS 的先前帧缓冲区数据并在后续帧中重新渲染该数据?我是否需要混合帧缓冲区 - 一个用于 GL_LINE 层,另一个用于 GL_POINTS 数据?
我尝试只调用presentFramebuffer而不调用setFramebuffer,但这会保留从先前帧绘制的每个GL_LINES - 这是我不想要的。如何保留部分帧缓冲区并删除其他部分?
My main scene is composed of GL_POINTS in 3D space. What I would like to do is be able to draw a single GL_LINES line (2d overlay) on top of the scene as the user moves his finger across the screen while retaining the underlaying 3D GL_POINTS state. I am having trouble understanding if this is possible. Do I need 2 framebuffers? How do I save the previous framebuffer data of GL_POINTS and re-render that in subsequent frames? Do I need to mix framebuffers - one for the GL_LINE layer and one for the GL_POINTS data?
I tried only calling presentFramebuffer without calling setFramebuffer but that is retaining each GL_LINES drawn from previous frames - which I do not want. How do I retain parts of the framebuffer and remove other parts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你根本不需要 2 个帧缓冲区
如果你的意思是帧缓冲区VBO(VertexBufferObject),那么它们是不一样的完全没有
一次使用 GL_POINTS,一次使用 GL_LINES/GL_LINE_LOOP 或其他
如果渲染不同的数据
如果您只需要单独的视图区域,那么您可以使用
you do not need a 2 frame-buffers at all
if you mean by frame-buffer VBO (VertexBufferObject) then they are not the same at all
once with GL_POINTS and once with GL_LINES/GL_LINE_LOOP or whatever
if you render different data
if you just need separate areas of view then you can use