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:
@@ -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. */
|
||||
|
||||
@@ -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]);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user