Fix #141013: VSE: Show pure emissive colors in preview

VSE doesn support pure emissive colors when rendering, but weren't
showed inside the preview. This was a limitation when the background
checkerbord is draw. It renders the alpha of the overlay to 1.0 making
the background be drawn on top of the image, hiding the pure emissive
colors.

This PR fixes this by clearing the alpha. This will render the
checkerboard below the image.

Another solution would be to set the alpha to zero in the theme, but that
adds confusion as theme colors will still be able to alter the support of
pure emissive colors.

Pull Request: https://projects.blender.org/blender/blender/pulls/146562
This commit is contained in:
Jeroen Bakker
2025-10-03 10:19:19 +02:00
parent 29e3785c51
commit c279d894db
3 changed files with 5 additions and 3 deletions

View File

@@ -1673,7 +1673,7 @@ static void sequencer_preview_draw_overlays(const bContext *C,
else if (space_sequencer.flag & SEQ_USE_ALPHA) {
/* Draw checked-board. */
const View2D &v2d = region.v2d;
imm_draw_box_checker_2d(v2d.tot.xmin, v2d.tot.ymin, v2d.tot.xmax, v2d.tot.ymax);
imm_draw_box_checker_2d(v2d.tot.xmin, v2d.tot.ymin, v2d.tot.xmax, v2d.tot.ymax, true);
/* Draw current and preview textures in a special way to pierce a hole in the overlay to make
* the actual image visible. */

View File

@@ -145,7 +145,7 @@ void imm_draw_box_checker_2d_ex(float x1,
const float color_primary[4],
const float color_secondary[4],
int checker_size);
void imm_draw_box_checker_2d(float x1, float y1, float x2, float y2);
void imm_draw_box_checker_2d(float x1, float y1, float x2, float y2, bool clear_alpha = false);
void imm_draw_cube_fill_3d(uint pos, const float center[3], const float aspect[3]);
void imm_draw_cube_wire_3d(uint pos, const float center[3], const float aspect[3]);

View File

@@ -484,12 +484,14 @@ void imm_draw_box_checker_2d_ex(float x1,
immUnbindProgram();
}
void imm_draw_box_checker_2d(float x1, float y1, float x2, float y2)
void imm_draw_box_checker_2d(float x1, float y1, float x2, float y2, bool clear_alpha)
{
float checker_primary[4];
float checker_secondary[4];
UI_GetThemeColor4fv(TH_TRANSPARENT_CHECKER_PRIMARY, checker_primary);
UI_GetThemeColor4fv(TH_TRANSPARENT_CHECKER_SECONDARY, checker_secondary);
checker_primary[3] = clear_alpha ? 0.0 : checker_primary[3];
checker_secondary[3] = clear_alpha ? 0.0 : checker_secondary[3];
int checker_size = UI_GetThemeValue(TH_TRANSPARENT_CHECKER_SIZE) * U.pixelsize;
imm_draw_box_checker_2d_ex(x1, y1, x2, y2, checker_primary, checker_secondary, checker_size);
}