Jump to content
  • Advertisement
Sign in to follow this  
Little Coding Fox

OpenGL Photoshop's Overlay filter in OpenGL ES 1.1 - Can it be done?

This topic is 2895 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey there,
I'm in need of replicating the functionality of Photoshop's overlay filter in OpenGL ES 1.1. It can be done easily in 2.0, but if i do so most of the devices my game runs on will not run it. The reason I need to somehow replicate that functionality in OpenGL ES 1.1 and not in some sort of preprocessing stage is that i already have it on said preprocessing stage, however it is far too slow and since it gets used often throughout the game's lifetime for menus and such, I want to optimize it. The formula is like so:


fragcolor = destination < .5 ? 2 * destination * source : 1 - 2 * (1 - destination) * (1 - source);


Where destination and source are the destination and source's currently being processed pixel.

So, I've done some research. I thought of using texture combiners, but i couldnt figure out how to add some sort of conditional to the texture processing, i searched for extensions, etc. I've already spent several days trying to figure out how to solve this. Does any of you have any idea on how i could accomplish this?

Thank you for your help.

Share this post


Link to post
Share on other sites
Advertisement
The problem is that the blending functions dont have an "if" statement - By that i mean that i can't tell OpenGL that if a pixel's overall values are less than .5, to multiply the two textures, and if not, to screen the two textures. The main problem is that it takes too long to preprocess the textures, and as such the game becomes indeed quite slow, so even if i made some sort of "filter textures", i'd still have the same problem, if not worse due to excessive use of resources.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!