Update METADATA to add clang-format
requirement for glsl files
also ran clang-format for good measure PiperOrigin-RevId: 600759938
This commit is contained in:
parent
cc62f0556c
commit
acc78125d2
@ -22,6 +22,6 @@ uniform float uAlphaScale;
|
||||
varying vec2 vTexSamplingCoord;
|
||||
|
||||
void main() {
|
||||
vec4 src = texture2D(uTexSampler, vTexSamplingCoord);
|
||||
gl_FragColor = vec4(src.rgb, src.a * uAlphaScale);
|
||||
vec4 src = texture2D(uTexSampler, vTexSamplingCoord);
|
||||
gl_FragColor = vec4(src.rgb, src.a * uAlphaScale);
|
||||
}
|
||||
|
@ -20,6 +20,4 @@ precision mediump float;
|
||||
uniform sampler2D uTexSampler;
|
||||
varying vec2 vTexSamplingCoord;
|
||||
|
||||
void main() {
|
||||
gl_FragColor = texture2D(uTexSampler, vTexSamplingCoord);
|
||||
}
|
||||
void main() { gl_FragColor = texture2D(uTexSampler, vTexSamplingCoord); }
|
||||
|
@ -156,7 +156,7 @@ highp vec3 applyPqBt2020ToBt709Ootf(highp vec3 linearRgbBt2020) {
|
||||
const float maxInputLuminance = maxMasteringLuminance;
|
||||
const float maxOutputLuminance = sdrMaxLuminance;
|
||||
|
||||
highp vec3 color = linearRgbBt2020 * pqMaxLuminance; // Scale luminance.
|
||||
highp vec3 color = linearRgbBt2020 * pqMaxLuminance; // Scale luminance.
|
||||
float nits = color.y;
|
||||
|
||||
nits = clamp(nits, 0.0, maxInputLuminance);
|
||||
@ -182,19 +182,20 @@ highp vec3 applyPqBt2020ToBt709Ootf(highp vec3 linearRgbBt2020) {
|
||||
} else if (nits < x2) {
|
||||
// Scale [x1, x2] to [y1, y2] using Hermite interpolation.
|
||||
float t = (nits - x1) / h12;
|
||||
nits = (y1 * (1.0 + 2.0 * t) + h12 * m1 * t) * (1.0 - t) * (1.0 - t)
|
||||
+ (y2 * (3.0 - 2.0 * t) + h12 * m2 * (t - 1.0)) * t * t;
|
||||
nits = (y1 * (1.0 + 2.0 * t) + h12 * m1 * t) * (1.0 - t) * (1.0 - t) +
|
||||
(y2 * (3.0 - 2.0 * t) + h12 * m2 * (t - 1.0)) * t * t;
|
||||
} else {
|
||||
// Scale [x2, maxInputLuminance] to [y2, maxOutputLuminance] using
|
||||
// Hermite interpolation.
|
||||
float t = (nits - x2) / h23;
|
||||
nits = (y2 * (1.0 + 2.0 * t) + h23 * m2 * t) * (1.0 - t) * (1.0 - t)
|
||||
+ (maxOutputLuminance * (3.0 - 2.0 * t) + h23 * m3 * (t - 1.0)) * t * t;
|
||||
nits =
|
||||
(y2 * (1.0 + 2.0 * t) + h23 * m2 * t) * (1.0 - t) * (1.0 - t) +
|
||||
(maxOutputLuminance * (3.0 - 2.0 * t) + h23 * m3 * (t - 1.0)) * t * t;
|
||||
}
|
||||
|
||||
// color.y is greater than 0 and is thus non-zero.
|
||||
color = color * (nits / color.y);
|
||||
return color / sdrMaxLuminance; // Normalize luminance.
|
||||
return color / sdrMaxLuminance; // Normalize luminance.
|
||||
}
|
||||
|
||||
highp vec3 applyBt2020ToBt709Ootf(highp vec3 linearRgbBt2020) {
|
||||
|
@ -148,7 +148,7 @@ highp vec3 applyPqBt2020ToBt709Ootf(highp vec3 linearRgbBt2020) {
|
||||
const float maxInputLuminance = maxMasteringLuminance;
|
||||
const float maxOutputLuminance = sdrMaxLuminance;
|
||||
|
||||
highp vec3 color = linearRgbBt2020 * pqMaxLuminance; // Scale luminance.
|
||||
highp vec3 color = linearRgbBt2020 * pqMaxLuminance; // Scale luminance.
|
||||
float nits = color.y;
|
||||
|
||||
nits = clamp(nits, 0.0, maxInputLuminance);
|
||||
@ -174,19 +174,20 @@ highp vec3 applyPqBt2020ToBt709Ootf(highp vec3 linearRgbBt2020) {
|
||||
} else if (nits < x2) {
|
||||
// Scale [x1, x2] to [y1, y2] using Hermite interpolation.
|
||||
float t = (nits - x1) / h12;
|
||||
nits = (y1 * (1.0 + 2.0 * t) + h12 * m1 * t) * (1.0 - t) * (1.0 - t)
|
||||
+ (y2 * (3.0 - 2.0 * t) + h12 * m2 * (t - 1.0)) * t * t;
|
||||
nits = (y1 * (1.0 + 2.0 * t) + h12 * m1 * t) * (1.0 - t) * (1.0 - t) +
|
||||
(y2 * (3.0 - 2.0 * t) + h12 * m2 * (t - 1.0)) * t * t;
|
||||
} else {
|
||||
// Scale [x2, maxInputLuminance] to [y2, maxOutputLuminance] using
|
||||
// Hermite interpolation.
|
||||
float t = (nits - x2) / h23;
|
||||
nits = (y2 * (1.0 + 2.0 * t) + h23 * m2 * t) * (1.0 - t) * (1.0 - t)
|
||||
+ (maxOutputLuminance * (3.0 - 2.0 * t) + h23 * m3 * (t - 1.0)) * t * t;
|
||||
nits =
|
||||
(y2 * (1.0 + 2.0 * t) + h23 * m2 * t) * (1.0 - t) * (1.0 - t) +
|
||||
(maxOutputLuminance * (3.0 - 2.0 * t) + h23 * m3 * (t - 1.0)) * t * t;
|
||||
}
|
||||
|
||||
// color.y is greater than 0 and is thus non-zero.
|
||||
color = color * (nits / color.y);
|
||||
return color / sdrMaxLuminance; // Normalize luminance.
|
||||
return color / sdrMaxLuminance; // Normalize luminance.
|
||||
}
|
||||
|
||||
highp vec3 applyBt2020ToBt709Ootf(highp vec3 linearRgbBt2020) {
|
||||
|
@ -21,15 +21,15 @@ uniform int uCount;
|
||||
varying vec2 vTexSamplingCoord;
|
||||
|
||||
void main() {
|
||||
// Translate the coordinates from -1,+1 to 0,+2.
|
||||
float x = aFramePosition.x + 1.0;
|
||||
// Offset the frame by its index times its width (2).
|
||||
x += float(uIndex) * 2.0;
|
||||
// Shrink the frame to fit the thumbnail strip.
|
||||
x /= float(uCount);
|
||||
// Translate the coordinates back to -1,+1.
|
||||
x -= 1.0;
|
||||
// Translate the coordinates from -1,+1 to 0,+2.
|
||||
float x = aFramePosition.x + 1.0;
|
||||
// Offset the frame by its index times its width (2).
|
||||
x += float(uIndex) * 2.0;
|
||||
// Shrink the frame to fit the thumbnail strip.
|
||||
x /= float(uCount);
|
||||
// Translate the coordinates back to -1,+1.
|
||||
x -= 1.0;
|
||||
|
||||
gl_Position = vec4(x, aFramePosition.yzw);
|
||||
vTexSamplingCoord = aFramePosition.xy * 0.5 + 0.5;
|
||||
gl_Position = vec4(x, aFramePosition.yzw);
|
||||
vTexSamplingCoord = aFramePosition.xy * 0.5 + 0.5;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user