Reputation: 448
So I'm working on a game and I'm wondering how I would achieve a similar effect to multiply in photoshop but in OpenGL. Too explain it better I have attached some images showing the steps that it would go through.
So to start with I have my image, which I render normally.
I then draw a black screen over it all.
Then I have my lights image, these are just white gradients.
After that I apply my multiply effect in photoshop:
How would I go about achieving the same effect but in opengl?
The lights would also have to blend together.
It doesn't matter how the effect was created in photoshop however, as long as I can create the same ending result.
I'm using LWJGL.
Upvotes: 0
Views: 555
Reputation: 35943
glBlendFunc(GL_DST_COLOR, GL_ZERO)
The resulting fragments drawn will be the multiplied value of the background (light) and incoming objects (quads).
Upvotes: 1