Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to create a depth of field effect with bokeh sprites in GLSL. Specifically, what i would like to do is, for each pixel:

  • See if the pixel is out of the focal range
  • If it is, draw a quad and apply a texture to provide a bokeh sprite.

This kind of implementation is seen in the Unreal Engine and by Matt Pettineo, however, both implementations are in DX11 and I'm using OpenGL.

I'm a bit stuck on the drawing a quad and applying a texture bit. Does anyone know how I can do this, or provide any relevant links as to how I can do this?


share|improve this question

closed as unclear what you're asking by MrCranky, Byte56 Mar 3 '14 at 19:46

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

You're stuck at "drawing a quad and applying a texture"? And you're trying to implement an advanced depth-of-field technique? Maybe you should slow down a bit, because if you can't draw a textured quad, you're not likely going to be able to draw DOF effects. – Nicol Bolas Sep 12 '12 at 1:47
Still, an answer may help future users. – Byte56 Sep 19 '12 at 0:03

Browse other questions tagged or ask your own question.