Sign in to follow this  
Gyiove Sparkle

Photoshop Color Dodge & glBlendFunc

Recommended Posts

Hello everyone!

Is there anyway possible to create photoshop color dodge effect ( target / (1.0 - blend) ) with glBlendFunc & glBlendEquation effect?

Anything near that effect would be great too but also saying that im willing to take any method you offer if the effect will be same.
( no matter how horrible the way is. )

I really need that blending effect.
Thanks!
 

Share this post


Link to post
Share on other sites

If you have the extension NV_blend_equation_advanced on your targeted machines, then you have "native" support by using the mode GL_COLOR_DOGE_NV. Otherwise AFAIK the only way to do color dodge is to program it into shader scripts.

Share this post


Link to post
Share on other sites

If you have the extension NV_blend_equation_advanced on your targeted machines, then you have "native" support by using the mode GL_COLOR_DOGE_NV. Otherwise AFAIK the only way to do color dodge is to program it into shader scripts.

Well, i have native support and i don't have it either.

jfuubp.jpg

When i run it with nvidia, my opengl versioon is 4.4 else its 4.0
How to make program to automatically pick the best graphic card and run with it?

Share this post


Link to post
Share on other sites

 

If you have the extension NV_blend_equation_advanced on your targeted machines, then you have "native" support by using the mode GL_COLOR_DOGE_NV. Otherwise AFAIK the only way to do color dodge is to program it into shader scripts.

Well, i have native support and i don't have it either.


When i run it with nvidia, my opengl versioon is 4.4 else its 4.0
How to make program to automatically pick the best graphic card and run with it?

 

 

There is no standard way to do such things.

In your case you can create an optimus profile that lets the drivers know you need the discrete card.

 

You can also use setoptimusprofile (sop):

http://drivenbynostalgia.com/stuff.html

Edited by Kaptein

Share this post


Link to post
Share on other sites
Now the question is how do i use this NV_blend_equation_advanced when i don't want to use glew?

As with every extension:

 

0.) Read the extension's specification.

1.) Check whether the extension is available within the running GL context.

   -- either the old way by using glGetString(GL_EXTENSIONS)

   -- or the new way by using glGetStringi(...) if supported

2.) Because the extension seems to run without special routines, you probably don't need to resolve symbols against it.

3.) Call the appropriate functions with the appropriate parameters.

 

There is another source of information that is more understandable what all those new parameters mean. The slides have the one or other error as I've seen, but an understanding of what's going on can be fetched from the slides definitely.

Edited by haegarr

Share this post


Link to post
Share on other sites

As written earlier: The most flexible approach is to write shader scripts that samples two input textures and do the calculations.

 

Accordingly to this page, the Divide blending mode is a simple as D / S (although I don't know how S==0 should be handled).

Share this post


Link to post
Share on other sites

If D stands for the pixel what is going to be blended in then how do i get the D?
You can't get the pixel what is going to be behind the object what in rendering...

If it would be that simple, i won't be here to ask those things :/
Really like that divide effect, but i guess i have to let it go...

Edited by Gyiove Sparkle

Share this post


Link to post
Share on other sites

D and S are used commonly used when describing blending as "destination" and "source", respectively, where destination means what is already there and source what is added now.

 

If both are available as textures, then a shader script can sample both, do the calculations, and store the result as new fragment as usual. If you need to generate one or both of them by rendering, then use FBOs with textures as renderable attachments, hen rebind them as textures for the blending step.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this