Files
test2/source/blender/gpu/shaders/gpu_shader_sequencer_strips_vert.glsl
Aras Pranckevicius 73d4872f5a Fix: VSE strip outline no longer extends outside of strip bounds
Previously selected strips in VSE timeline were drawing their outline
1px outside of the strip boundaries. This makes outlines of the strips
overlap each other when neighboring strips are selected.

Now the selected outline is fully within regular strip shape.

Pull Request: https://projects.blender.org/blender/blender/pulls/122890
2024-06-07 17:41:56 +02:00

34 lines
734 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 2px to fit possible pixel grid rounding. */
vec2 expand = vec2(context_data.pixelx, context_data.pixely);
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);
}