.
This commit is contained in:
@@ -96,6 +96,21 @@ int findMostPerceptuallyAccurateColor(vec3 color) {
|
||||
return bestMatchIndex;
|
||||
}
|
||||
|
||||
//int findMostPerceptuallyAccurateColor(vec3 color) {
|
||||
// int closestIndex = 0;
|
||||
// float minDistance = distance(color, ConsoleColorVec3[0]);
|
||||
//
|
||||
// for (int i = 1; i < 16; i++) {
|
||||
// float dist = distance(color, ConsoleColorVec3[i]);
|
||||
// if (dist < minDistance) {
|
||||
// minDistance = dist;
|
||||
// closestIndex = i;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return closestIndex;
|
||||
//}
|
||||
|
||||
// Enhanced luminosity calculation considering human perception
|
||||
float calculatePerceptualLuminance(vec3 color) {
|
||||
// BT.709 luminance coefficients with slight adjustment
|
||||
@@ -118,7 +133,7 @@ layout (location = 0) in vec2 iUV;
|
||||
layout (location = 0) out vec4 FragColor;
|
||||
|
||||
void main() {
|
||||
vec3 pixelColor = texture(uInputTexture, iUV).rgb;
|
||||
vec3 pixelColor = texture(uInputTexture, iUV * 4).rgb;
|
||||
|
||||
// Find most perceptually accurate console color
|
||||
int colorIndex = findMostPerceptuallyAccurateColor(pixelColor);
|
||||
|
||||
Reference in New Issue
Block a user