PDA

View Full Version : Some sort of blending?



Gavin
08-17-2006, 06:29 AM
I need to do gamma correction on my buffer. Vurrently i do it per pixel, but thats getting too slow now. How can i alter all the r, g, b channels independantly in the buffer by a given amount/equation?

Zengar
08-17-2006, 08:11 AM
The simplest what comes to my mind is using a fragment shader. Is it an option for you? If not, just gnore my post ;-)

glAren
08-17-2006, 08:25 AM
check this tutorial:
http://www.codeproject.com/miscctrl/gamma_manager.asp?df=100&forumid=13288&exp=0&select=506149

Gavin
08-17-2006, 09:48 AM
Well i noticed the gammaramp API call but also noticed a few places back in 2002 saying that its isnt implemented on many cards, and thought they were pahsing it out not in? Anyway couldnt get it to do anything on my app.

Gavin
08-17-2006, 09:58 AM
Actually no it must be my cack coding, the demo works!

Gavin
08-17-2006, 01:21 PM
Anyone know how the gamma curve (correction factor) is applied to within the setdevicegammaramp function? i need to know so i can implement my own gamma corretion function. ta

glAren
08-18-2006, 02:18 AM
check this article: http://www.delphi3d.net/articles/viewarticle.php?article=gamma.htm

Gavin
08-18-2006, 02:23 AM
Yep seen that, but we use a different gamma correction equation/curve, and so i need to know what setgamma does once it receives the gamma correction curve/ramp, as in how it applies it to the frame buffer

Relic
08-18-2006, 04:24 AM
Read the manual. It's a simple mapping of R, G, and B channels from display RAM contents to monitor output done on the fly by the DAC and described as a table of 256 entries for R, G and B. Means it does not affect the frame buffer contents, just the monitor output.
However you generate that table is your choice.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/icm/icm_0yi8.asp
If you need to modyfy the pixel data itself, write a fragment shader.