Hi guys,
Been playing around with converting RGB data to YCoCg before compressing to DXT and the quality has really improved, but I'm facing one last problem which is illumination, I believe. The image looks slightly more colorful, and brighter.
I followed an article at NVidia and came up with this in the pixel shader:
float Co = color.r - 0.5; //( 0.5 * 256.0 / 255.0 );
float Cg = color.g - 0.5; // ( 0.5 * 256.0 / 255.0 );
float Y = color.a;
resultColor.r = Y + Co - Cg;
resultColor.g = Y + Cg;
resultColor.a = depthColor.b;
resultColor.b = Y - Co - Cg;
//resultColor *= 0.98;
I have to scale down the colors a bit or they are too bright and colorful. That suggests to me that I'm doing something wrong to begin with, and NVidias site shows an example in GLSL:
DP4 result.color.x, color, { 1.0, -1.0, 0.0 * 256.0 / 255.0, 1.0 };
DP4 result.color.y, color, { 0.0, 1.0, -0.5 * 256.0 / 255.0, 1.0 };
DP4 result.color.z, color, { -1.0, -1.0, 1.0 * 256.0 / 255.0, 1.0 };
Looks like I'm missing something, right? I'm not using any dot products. Should I?
If anyone knows of any example shaders that do this conversation, or if you got any clue what's going on, I'd appreciate it a lot.
Thanks!
[Edited by - SymLinked on December 10, 2008 5:31:06 PM]