Skip to content

need help for bloom effect with twgl #198

Answered by greggman
tiye asked this question in Q&A
Discussion options

You must be logged in to vote

IIRC A bloom filter is a multi-step process

  1. Render the scene to a texture (scene-texture)
  2. Render the scene-texture to another texture (bright-texture) with a shader that discards any pixels below a certain brightness level. How you compute brightness is up to you.
  3. Blur the previous bright-texture into a blur-texture (this might take 2 steps for speed)
  4. Draw the (scene-texture) blended (added) with blur-texture.

This article goes over the steps, including step 3 using 2 steps.

See: https://learnopengl.com/Advanced-Lighting/Bloom

Step 2 can also be done with special data where you mark certain materials as "glowing". It'd be up to you how to specify that data. Some people use a glow textur…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@greggman
Comment options

Answer selected by tiye
Comment options

You must be logged in to vote
1 reply
@greggman
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants
Converted from issue

This discussion was converted from issue #197 on June 28, 2022 21:42.