如何为 OpenGL 的线条添加发光效果? [英] How to add glowing effect to a line for OpenGL?
本文介绍了如何为 OpenGL 的线条添加发光效果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何为我绘制的线条添加发光效果?我在 Linux 上使用 OpenGL.
How can I add a glowing effect to a line that I draw? I'm using OpenGL for Linux.
推荐答案
您可以实现 Nehe 第 36 课.主要思想是将绘图渲染到纹理,并在每次渲染后以小偏移量执行 N 次,直到绘图准备好复制到帧缓冲区.
You can implement the radial blur effect described on Nehe Lesson 36. The main idea is to render the drawing to a texture, and do that N times with a small offset after each render, until the drawing is ready to be copied to the framebuffer.
我编写了一个使用 Qt 和 OpenGL 的小演示.您可以在下面看到原始绘图(没有模糊):
I've written a small demo that uses Qt and OpenGL. You can see the original drawing (without the blur) below:
下图显示了打开模糊效果的绘图:
我知道这并不多,但这是一个开始.
I know it's not much, but it's a start.
这篇关于如何为 OpenGL 的线条添加发光效果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文