VSE timeline widget drawing is done in "timeline space" (x: frames, y: channels), but that can have precision issues at large frames, when "pixel size features" (outlines, borders) need to get evaluated inside a shader. This can lead to inconsistent border sizes between neighboring strips, e.g. sometimes it would be 2 pixels, but sometiems 3 pixels. I've seen this mostly happen when frames get into 100'000+ range. To address this, switch timeline widget drawing to be in window pixel space. This avoids the issue since coordinates to draw the strip widgets become "up to several thousand" range, not arbitrarily large. Pull Request: https://projects.blender.org/blender/blender/pulls/125220
34 lines
693 B
GLSL
34 lines
693 B
GLSL
/* SPDX-FileCopyrightText: 2024 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
void main()
|
|
{
|
|
int id = gl_InstanceID;
|
|
strip_id = id;
|
|
int vid = gl_VertexID;
|
|
SeqStripDrawData strip = strip_data[id];
|
|
vec4 rect = vec4(strip.left_handle, strip.bottom, strip.right_handle, strip.top);
|
|
/* Expand by 1px to fit pixel grid rounding. */
|
|
vec2 expand = vec2(1.0, 1.0);
|
|
rect.xy -= expand;
|
|
rect.zw += expand;
|
|
|
|
vec2 co;
|
|
if (vid == 0) {
|
|
co = rect.xw;
|
|
}
|
|
else if (vid == 1) {
|
|
co = rect.xy;
|
|
}
|
|
else if (vid == 2) {
|
|
co = rect.zw;
|
|
}
|
|
else {
|
|
co = rect.zy;
|
|
}
|
|
|
|
co_interp = co;
|
|
gl_Position = ModelViewProjectionMatrix * vec4(co, 0.0f, 1.0f);
|
|
}
|