[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Public WebGL] Premultiplied alpha blending and issues with color accuracy
If all of these suggestions that you and Ben have so helpfully provided
and explained to me should work out for me, I'll have a piece of
software you can do high quality drawing in ready in not too long.
Oh, and on the sunny side of things, OpenGL and shaders are giving me
new options in some other areas:
- I'm actually using the JPEG2000 RCT color space for my color channels,
storing Y, Cb and Cr in the R, G and B channels respectively. This has
the interesting side effect of allowing me to treat color like a complex
number. Rotating (Cb, Cr) takes you through the color circle. Altering
the magnitude alters the saturation. Linear interpolation gives pleasing
results, because even complementary colors share the same brightness, so
gamma encoded colors don't skew it as much.
- In addition to this, I have been experimenting with gamma. Linear
gamma, x^(1/2.2), would provide perfect color mixing even with RGB, but
this makes dark grays look like absolute s**t at 8 bits per channel. I
then tried a gamma of 1.8, x^(1.8/2.2), the one used by old Apple
machines. The RCT color mixing was already good, but this took it up
another notch, while still rendering dark shades of gray without
banding. I have yet to add the linear section specified in sRGB. 2.2 is
an adequate approximation for the time being.
If it seems like I'm spending too much time on these details, you
haven't heard hundreds of artists complain about the muddy color mixing
in their painting tools yet. ;)
Thor
-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email:
unsubscribe public_webgl
-----------------------------------------------------------