Author Topic: All Photoshop blending modes + RGB to HSL, contrast, etc. in a GLSL shader  (Read 8500 times)

0 Members and 1 Guest are viewing this topic.

Romz

  • Associate
  • Posts: 4
Hi there,

Something that might interest you.. all the Photoshop blending modes as GLSL macros + RGB to HSL (hue, saturation, luminance), contrast, desaturation.
Everything is here.

Of course it's open to discussion and I know for sure .. optimization!
I did everything in my own little Ogre editor/demo engine (which stays very basic but very convenient and fast to make new Ogre 'demos'), so I wanted to share my shader code with you too ;)





Hope it could help.

Romz

--

Update 22/01/2009:
Gamma correction filter added.

Update 28/01/2009:
Complete Levels control added.
« Last Edit: January 28, 2009, 12:33:14 AM by Romz »

shadow

  • Capo Regime
  • ***
  • Posts: 353
Very interesting idea !
I already used features such as saturation in my shaders... But not many others included in your work.

Thanks for sharing, those willing to learn GLSL will enjoy this !

Are you planning to release something like a small app with those effects, or did you do this "just for fun" ?
3D, photos panoramiques : http://www.shadows.fr

JeGX

  • Global Moderator
  • Capo Crimine
  • *****
  • Posts: 2391
    • oZone3D.Net
Thanks for the info. Will test your GLSL shaders with Demoniak3D very soon  :saut:
But I believe this news was already in Geeks3D daily round-up: http://www.geeks3d.com/?p=2981   :twisted:

Romz

  • Associate
  • Posts: 4
I'm sorry but in a last minute change I made a mistake in the code, and I also had some issues on specific hardware due to conditional returns, but now it's fixed and if you already have the .glsl file you should re-download it (same link).

And good news, now it's also in HLSL.

JeGX, very cool, please share any screenshot :)

Shadow, I'm not planning to release any app soon for this, sorry. The goal is not to demonstrate the blending modes, there are plenty of tutorials and references online, but just to directly translate full-screen processes in shader code. I might just be publishing some cool results if I have any with the corresponding code.

Thank you!

JeGX

  • Global Moderator
  • Capo Crimine
  • *****
  • Posts: 2391
    • oZone3D.Net
JeGX, very cool, please share any screenshot :)
Yep, no problem. As soon as I have something to show, I show it!

Shadow, I'm not planning to release any app soon for this, sorry. The goal is not to demonstrate the blending modes, there are plenty of tutorials and references online, but just to directly translate full-screen processes in shader code. I might just be publishing some cool results if I have any with the corresponding code.
Demoniak3D micro-demos will do the job  :twisted:

Romz

  • Associate
  • Posts: 4
Hi,

Just added a gamma correction filter. Just like the Exposure/gamma or Levels/midtone in photoshop.



Details and code here:
http://blog.mouaif.org/2009/01/22/photoshop-gamma-correction-shader/

Romz

  • Associate
  • Posts: 4
Hi,

I added the complete reproduction of the Photoshop Levels control.



Details and code here: http://blog.mouaif.org/2009/01/28/levels-control-shader/

shadow

  • Capo Regime
  • ***
  • Posts: 353
Very nice, one more time !  :med:

By the way... JeGX, having such tools might be interesting in Demoniak, as a postprocessing stage. I guess one way to do that would be to render a scene to texture, then to use a shader on this texture ?
3D, photos panoramiques : http://www.shadows.fr