开发者

OpenGL ES flash of bright light

I'm having some trouble achieving my desired effect in an OpenGL ES app I'm working on. I can use OpenGL ES 1.1 or 2.0. What I'm trying to achieve is the following...

In a 2D ortho scene (black clear color), render a red square to the screen with some transparency so it is a darker red (or just set to darker red color). This is no problem for me. Then, when a user clicks in the region of the square, I want it to quickly flash in a bright flash of light (just in the region of the square). This flash doesn't have to persist long at all, just enough that if the user was in a completely dark room, this flash of light would create a brief noticeable flash in the users face. I've been having some trouble getting a "light bloom" or glow effect to work efficiently, and was wondering if anyone had ideas for a quick, efficient way to make the color flash brightly for a split second. Possibly through the use of some kind of texturing trick that I don't know of. Also, the flash doesn't have to blur outside of the开发者_运维技巧 region, it can be fully contained within the region with sharp edges. Really all I'm after is the aesthetic of the flash lighting the immediate area around the screen.


Disable texturing, glColor3ub(255,255,255), render square, wait a bit, redraw square normally.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜