Merge branch 'blender-v2.91-release'

Conflicts:
	source/blender/editors/render/render_opengl.c
	source/blender/sequencer/intern/effects.c
This commit is contained in:
Richard Antalik 2020-11-17 04:10:51 +01:00
commit 797dfa6a0a
6 changed files with 34 additions and 12 deletions

View File

@ -72,6 +72,7 @@ enum {
QUAD_Z_MAX = 5,
};
#ifdef WITH_OPENVDB
const int quads_indices[6][4] = {
/* QUAD_X_MIN */
{4, 0, 3, 7},
@ -136,6 +137,7 @@ static void create_quad(int3 corners[8],
quads.push_back(quad);
}
#endif
/* Create a mesh from a volume.
*
@ -280,6 +282,7 @@ void VolumeMeshBuilder::create_mesh(vector<float3> &vertices,
vector<float3> &face_normals,
const float face_overlap_avoidance)
{
#ifdef WITH_OPENVDB
/* We create vertices in index space (is), and only convert them to object
* space when done. */
vector<int3> vertices_is;
@ -294,6 +297,12 @@ void VolumeMeshBuilder::create_mesh(vector<float3> &vertices,
convert_object_space(vertices_is, vertices, face_overlap_avoidance);
convert_quads_to_tris(quads, indices, face_normals);
#else
(void)vertices;
(void)indices;
(void)face_normals;
(void)face_overlap_avoidance;
#endif
}
void VolumeMeshBuilder::generate_vertices_and_quads(vector<ccl::int3> &vertices_is,

View File

@ -490,13 +490,13 @@ static void screen_opengl_render_apply(const bContext *C, OGLRender *oglrender)
int chanshown = sseq ? sseq->chanshown : 0;
SEQ_render_new_render_data(oglrender->bmain,
oglrender->depsgraph,
scene,
oglrender->sizex,
oglrender->sizey,
100,
false,
&context);
oglrender->depsgraph,
scene,
oglrender->sizex,
oglrender->sizey,
SEQ_RENDER_SIZE_SCENE,
false,
&context);
for (view_id = 0; view_id < oglrender->views_len; view_id++) {
context.view_id = view_id;

View File

@ -180,6 +180,11 @@ static void wide_line_workaround_start(GPUPrimType prim_type)
immUniform2fv("viewportSize", &viewport[2]);
immUniform1f("lineWidth", line_width);
if (GPU_blend_get() == GPU_BLEND_NONE) {
/* Disable line smoothing when blending is disabled (see T81827). */
immUniform1i("lineSmooth", 0);
}
if (ELEM(polyline_sh,
GPU_SHADER_3D_POLYLINE_CLIPPED_UNIFORM_COLOR,
GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR)) {
@ -190,6 +195,10 @@ static void wide_line_workaround_start(GPUPrimType prim_type)
static void wide_line_workaround_end()
{
if (imm->prev_shader) {
if (GPU_blend_get() == GPU_BLEND_NONE) {
/* Restore default. */
immUniform1i("lineSmooth", 1);
}
immUnbindProgram();
immBindShader(imm->prev_shader);

View File

@ -1,5 +1,6 @@
uniform float lineWidth;
uniform bool lineSmooth = true;
in vec4 finalColor;
noperspective in float smoothline;
@ -19,6 +20,8 @@ void main()
}
#endif
fragColor = finalColor;
fragColor.a *= clamp((lineWidth + SMOOTH_WIDTH) * 0.5 - abs(smoothline), 0.0, 1.0);
if (lineSmooth) {
fragColor.a *= clamp((lineWidth + SMOOTH_WIDTH) * 0.5 - abs(smoothline), 0.0, 1.0);
}
fragColor = blender_srgb_to_framebuffer_space(fragColor);
}

View File

@ -5,6 +5,7 @@ layout(triangle_strip, max_vertices = 4) out;
uniform vec4 color;
uniform vec2 viewportSize;
uniform float lineWidth;
uniform bool lineSmooth = true;
#if !defined(UNIFORM)
in vec4 finalColor_g[];
@ -53,12 +54,12 @@ void do_vertex(const int i, vec4 pos, vec2 ofs)
clip = clip_g[i];
#endif
smoothline = (lineWidth + SMOOTH_WIDTH) * 0.5;
smoothline = (lineWidth + SMOOTH_WIDTH * float(lineSmooth)) * 0.5;
gl_Position = pos;
gl_Position.xy += ofs * pos.w;
EmitVertex();
smoothline = -(lineWidth + SMOOTH_WIDTH) * 0.5;
smoothline = -(lineWidth + SMOOTH_WIDTH * float(lineSmooth)) * 0.5;
gl_Position = pos;
gl_Position.xy -= ofs * pos.w;
EmitVertex();
@ -77,7 +78,7 @@ void main(void)
vec2 ofs = vec2(-e.y, e.x);
#endif
ofs /= viewportSize.xy;
ofs *= lineWidth + SMOOTH_WIDTH;
ofs *= lineWidth + SMOOTH_WIDTH * float(lineSmooth);
do_vertex(0, p0, ofs);
do_vertex(1, p1, ofs);

View File

@ -3915,7 +3915,7 @@ static ImBuf *do_text_effect(const SeqRenderData *context,
/* Compensate text size for preview render size. */
proxy_size_comp = context->scene->r.size / 100.0;
if (context->preview_render_size != SEQ_RENDER_SIZE_SCENE) {
proxy_size_comp *= SEQ_rendersize_to_scale_factor(context->preview_render_size);
proxy_size_comp = SEQ_rendersize_to_scale_factor(context->preview_render_size);
}
/* set before return */