diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2021-07-18 14:14:23 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2021-07-18 14:14:23 +0300 |
commit | ca50a1f762703d477ee84cf494dec601fd540299 (patch) | |
tree | fbd86a77e77015d7cc6becc1255a63e436a45b2a /source/blender/draw/engines/overlay | |
parent | d35969a74ff7a71fc0ca233ae65a2f1c47eb9a25 (diff) | |
parent | e82c5c660778b3805f50f3f2901923692c17db2a (diff) |
Merge branch 'master' into geometry-nodes-unnamed-attributesgeometry-nodes-unnamed-attributes
Diffstat (limited to 'source/blender/draw/engines/overlay')
18 files changed, 36 insertions, 32 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_armature.c b/source/blender/draw/engines/overlay/overlay_armature.c index 0e350ea5a68..9d15f0e176d 100644 --- a/source/blender/draw/engines/overlay/overlay_armature.c +++ b/source/blender/draw/engines/overlay/overlay_armature.c @@ -37,6 +37,7 @@ #include "BKE_action.h" #include "BKE_armature.h" +#include "BKE_deform.h" #include "BKE_modifier.h" #include "DEG_depsgraph_query.h" @@ -699,7 +700,7 @@ static void drw_shgroup_bone_ik_spline_lines(ArmatureDrawContext *ctx, /* -------------------------------------------------------------------- */ /** \name Drawing Theme Helpers * - * Note, this section is duplicate of code in 'drawarmature.c'. + * \note this section is duplicate of code in 'drawarmature.c'. * * \{ */ @@ -1036,7 +1037,7 @@ static void draw_bone_update_disp_matrix_default(EditBone *eBone, bPoseChannel * float(*disp_mat)[4]; float(*disp_tail_mat)[4]; - /* TODO : This should be moved to depsgraph or armature refresh + /* TODO: This should be moved to depsgraph or armature refresh * and not be tight to the draw pass creation. * This would refresh armature without invalidating the draw cache */ if (pchan) { @@ -1200,9 +1201,9 @@ static void draw_bone_update_disp_matrix_bbone(EditBone *eBone, bPoseChannel *pc float(*bone_mat)[4]; short bbone_segments; - /* TODO : This should be moved to depsgraph or armature refresh + /* TODO: This should be moved to depsgraph or armature refresh * and not be tight to the draw pass creation. - * This would refresh armature without invalidating the draw cache */ + * This would refresh armature without invalidating the draw cache. */ if (pchan) { length = pchan->bone->length; xwidth = pchan->bone->xwidth; @@ -1268,7 +1269,7 @@ static void draw_bone_update_disp_matrix_custom(bPoseChannel *pchan) float(*disp_tail_mat)[4]; float rot_mat[3][3]; - /* See TODO above */ + /* See TODO: above. */ mul_v3_v3fl(bone_scale, pchan->custom_scale_xyz, PCHAN_CUSTOM_BONE_LENGTH(pchan)); bone_mat = pchan->custom_tx ? pchan->custom_tx->pose_mat : pchan->pose_mat; disp_mat = pchan->disp_mat; @@ -2040,7 +2041,8 @@ static void draw_armature_pose(ArmatureDrawContext *ctx) const Object *obact_orig = DEG_get_original_object(draw_ctx->obact); - LISTBASE_FOREACH (bDeformGroup *, dg, &obact_orig->defbase) { + const ListBase *defbase = BKE_object_defgroup_list(obact_orig); + LISTBASE_FOREACH (const bDeformGroup *, dg, defbase) { if (dg->flag & DG_LOCK_WEIGHT) { pchan = BKE_pose_channel_find_name(ob->pose, dg->name); diff --git a/source/blender/draw/engines/overlay/overlay_edit_mesh.c b/source/blender/draw/engines/overlay/overlay_edit_mesh.c index 7639911286f..a7ed6c777e8 100644 --- a/source/blender/draw/engines/overlay/overlay_edit_mesh.c +++ b/source/blender/draw/engines/overlay/overlay_edit_mesh.c @@ -26,6 +26,7 @@ #include "DNA_mesh_types.h" +#include "BKE_customdata.h" #include "BKE_editmesh.h" #include "draw_cache_impl.h" diff --git a/source/blender/draw/engines/overlay/overlay_edit_uv.c b/source/blender/draw/engines/overlay/overlay_edit_uv.c index 01ab47ac1de..c2b130163e8 100644 --- a/source/blender/draw/engines/overlay/overlay_edit_uv.c +++ b/source/blender/draw/engines/overlay/overlay_edit_uv.c @@ -24,6 +24,7 @@ #include "draw_cache_impl.h" #include "draw_manager_text.h" +#include "BKE_customdata.h" #include "BKE_editmesh.h" #include "BKE_image.h" #include "BKE_layer.h" diff --git a/source/blender/draw/engines/overlay/overlay_engine.c b/source/blender/draw/engines/overlay/overlay_engine.c index 81b07b49784..235104245cc 100644 --- a/source/blender/draw/engines/overlay/overlay_engine.c +++ b/source/blender/draw/engines/overlay/overlay_engine.c @@ -200,7 +200,7 @@ static void OVERLAY_cache_init(void *vedata) case CTX_MODE_OBJECT: break; default: - BLI_assert(!"Draw mode invalid"); + BLI_assert_msg(0, "Draw mode invalid"); break; } OVERLAY_antialiasing_cache_init(vedata); diff --git a/source/blender/draw/engines/overlay/overlay_extra.c b/source/blender/draw/engines/overlay/overlay_extra.c index b70c71de188..f5be9c846d1 100644 --- a/source/blender/draw/engines/overlay/overlay_extra.c +++ b/source/blender/draw/engines/overlay/overlay_extra.c @@ -928,7 +928,7 @@ static void camera_view3d_reconstruction(OVERLAY_ExtraCallBuffers *cb, const float *bundle_color; if (track->flag & TRACK_CUSTOMCOLOR) { /* Meh, hardcoded srgb transform here. */ - /* TODO change the actual DNA color to be linear. */ + /* TODO: change the actual DNA color to be linear. */ srgb_to_linearrgb_v3_v3(bundle_color_custom, track->color); bundle_color = bundle_color_custom; } diff --git a/source/blender/draw/engines/overlay/overlay_gpencil.c b/source/blender/draw/engines/overlay/overlay_gpencil.c index aa26aa47faa..5c03d70d7be 100644 --- a/source/blender/draw/engines/overlay/overlay_gpencil.c +++ b/source/blender/draw/engines/overlay/overlay_gpencil.c @@ -431,7 +431,7 @@ static void OVERLAY_gpencil_color_names(Object *ob) const DRWContextState *draw_ctx = DRW_context_state_get(); int cfra = DEG_get_ctime(draw_ctx->depsgraph); - BKE_gpencil_visible_stroke_iter( + BKE_gpencil_visible_stroke_advanced_iter( NULL, ob, NULL, overlay_gpencil_draw_stroke_color_name, ob, false, cfra); } diff --git a/source/blender/draw/engines/overlay/overlay_outline.c b/source/blender/draw/engines/overlay/overlay_outline.c index a2c3b5bf4aa..e3f01d968ae 100644 --- a/source/blender/draw/engines/overlay/overlay_outline.c +++ b/source/blender/draw/engines/overlay/overlay_outline.c @@ -36,7 +36,7 @@ /* Returns the normal plane in NDC space. */ static void gpencil_depth_plane(Object *ob, float r_plane[4]) { - /* TODO put that into private data. */ + /* TODO: put that into private data. */ float viewinv[4][4]; DRW_view_viewmat_get(NULL, viewinv, true); float *camera_z_axis = viewinv[2]; @@ -92,7 +92,7 @@ void OVERLAY_outline_init(OVERLAY_Data *vedata) DefaultTextureList *dtxl = DRW_viewport_texture_list_get(); if (DRW_state_is_fbo()) { - /* TODO only alloc if needed. */ + /* TODO: only alloc if needed. */ DRW_texture_ensure_fullscreen_2d(&txl->temp_depth_tx, GPU_DEPTH24_STENCIL8, 0); DRW_texture_ensure_fullscreen_2d(&txl->outlines_id_tx, GPU_R16UI, 0); @@ -263,13 +263,13 @@ static void OVERLAY_outline_gpencil(OVERLAY_PrivateData *pd, Object *ob) gpencil_depth_plane(ob, iter.plane); } - BKE_gpencil_visible_stroke_iter(NULL, - ob, - gpencil_layer_cache_populate, - gpencil_stroke_cache_populate, - &iter, - false, - pd->cfra); + BKE_gpencil_visible_stroke_advanced_iter(NULL, + ob, + gpencil_layer_cache_populate, + gpencil_stroke_cache_populate, + &iter, + false, + pd->cfra); } static void OVERLAY_outline_volume(OVERLAY_PrivateData *pd, Object *ob) diff --git a/source/blender/draw/engines/overlay/overlay_private.h b/source/blender/draw/engines/overlay/overlay_private.h index a48b46a61fc..03bfaf56f24 100644 --- a/source/blender/draw/engines/overlay/overlay_private.h +++ b/source/blender/draw/engines/overlay/overlay_private.h @@ -314,7 +314,7 @@ typedef struct OVERLAY_PrivateData { DRWView *view_edit_text; DRWView *view_reference_images; - /** TODO get rid of this. */ + /** TODO: get rid of this. */ ListBase smoke_domains; ListBase bg_movie_clips; @@ -333,8 +333,8 @@ typedef struct OVERLAY_PrivateData { bool xray_enabled; bool xray_enabled_and_not_wire; float xray_opacity; - short v3d_flag; /* TODO move to View3DOverlay */ - short v3d_gridflag; /* TODO move to View3DOverlay */ + short v3d_flag; /* TODO: move to #View3DOverlay. */ + short v3d_gridflag; /* TODO: move to #View3DOverlay. */ int cfra; DRWState clipping_state; OVERLAY_ShadingData shdata; diff --git a/source/blender/draw/engines/overlay/overlay_shader.c b/source/blender/draw/engines/overlay/overlay_shader.c index c9c26e3faaa..7a7ae9a921b 100644 --- a/source/blender/draw/engines/overlay/overlay_shader.c +++ b/source/blender/draw/engines/overlay/overlay_shader.c @@ -1726,7 +1726,7 @@ OVERLAY_InstanceFormats *OVERLAY_shader_instance_formats_get(void) { {"boneStart", DRW_ATTR_FLOAT, 3}, {"boneEnd", DRW_ATTR_FLOAT, 3}, - {"wireColor", DRW_ATTR_FLOAT, 4}, /* TODO uchar color */ + {"wireColor", DRW_ATTR_FLOAT, 4}, /* TODO: uchar color. */ {"boneColor", DRW_ATTR_FLOAT, 4}, {"headColor", DRW_ATTR_FLOAT, 4}, {"tailColor", DRW_ATTR_FLOAT, 4}, diff --git a/source/blender/draw/engines/overlay/shaders/antialiasing_frag.glsl b/source/blender/draw/engines/overlay/shaders/antialiasing_frag.glsl index c204949cc45..67d172fbd01 100644 --- a/source/blender/draw/engines/overlay/shaders/antialiasing_frag.glsl +++ b/source/blender/draw/engines/overlay/shaders/antialiasing_frag.glsl @@ -105,7 +105,7 @@ void main() float dist_raw = texelFetch(lineTex, center_texel, 0).b; float dist = decode_line_dist(dist_raw); - /* TODO Opti: use textureGather */ + /* TODO: Opti: use textureGather. */ vec4 neightbor_col0 = texelFetchOffset(colorTex, center_texel, 0, ivec2(1, 0)); vec4 neightbor_col1 = texelFetchOffset(colorTex, center_texel, 0, ivec2(-1, 0)); vec4 neightbor_col2 = texelFetchOffset(colorTex, center_texel, 0, ivec2(0, 1)); diff --git a/source/blender/draw/engines/overlay/shaders/armature_shape_outline_vert.glsl b/source/blender/draw/engines/overlay/shaders/armature_shape_outline_vert.glsl index 45ebad0aafe..ddc6328e6a2 100644 --- a/source/blender/draw/engines/overlay/shaders/armature_shape_outline_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/armature_shape_outline_vert.glsl @@ -36,7 +36,7 @@ void main() /* This is slow and run per vertex, but it's still faster than * doing it per instance on CPU and sending it on via instance attribute. */ mat3 normal_mat = transpose(inverse(mat3(model_mat))); - /* TODO FIX: there is still a problem with this vector + /* TODO: FIX: there is still a problem with this vector * when the bone is scaled or in persp mode. But it's * barely visible at the outline corners. */ ssNor = normalize(normal_world_to_view(normal_mat * snor).xy); diff --git a/source/blender/draw/engines/overlay/shaders/armature_shape_solid_frag.glsl b/source/blender/draw/engines/overlay/shaders/armature_shape_solid_frag.glsl index 17e8d0da5d9..26796c82f66 100644 --- a/source/blender/draw/engines/overlay/shaders/armature_shape_solid_frag.glsl +++ b/source/blender/draw/engines/overlay/shaders/armature_shape_solid_frag.glsl @@ -9,8 +9,8 @@ layout(location = 1) out vec4 lineOutput; void main() { - /* Manual backface cullling.. Not ideal for performance - * but needed for view clarity in xray mode and support + /* Manual back-face culling. Not ideal for performance + * but needed for view clarity in X-ray mode and support * for inverted bone matrices. */ if ((inverted == 1) == gl_FrontFacing) { discard; diff --git a/source/blender/draw/engines/overlay/shaders/edit_uv_verts_vert.glsl b/source/blender/draw/engines/overlay/shaders/edit_uv_verts_vert.glsl index cb70a3b433c..b241a1f0568 100644 --- a/source/blender/draw/engines/overlay/shaders/edit_uv_verts_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/edit_uv_verts_vert.glsl @@ -11,7 +11,7 @@ out vec4 fillColor; out vec4 outlineColor; out vec4 radii; -/* TODO Theme? */ +/* TODO: Theme? */ const vec4 pinned_col = vec4(1.0, 0.0, 0.0, 1.0); void main() diff --git a/source/blender/draw/engines/overlay/shaders/outline_detect_frag.glsl b/source/blender/draw/engines/overlay/shaders/outline_detect_frag.glsl index 1c54076f3ea..df10f3f7ae2 100644 --- a/source/blender/draw/engines/overlay/shaders/outline_detect_frag.glsl +++ b/source/blender/draw/engines/overlay/shaders/outline_detect_frag.glsl @@ -279,7 +279,7 @@ void main() vec2 line_start, line_end; vec2 line_ofs; bvec4 extra_edges, extra_edges2; - /* TODO simplify this branching hell. */ + /* TODO: simplify this branching hell. */ switch (edge_case) { /* Straight lines. */ case YPOS: diff --git a/source/blender/draw/engines/overlay/shaders/outline_prepass_geom.glsl b/source/blender/draw/engines/overlay/shaders/outline_prepass_geom.glsl index 282799e1660..b89cd821b37 100644 --- a/source/blender/draw/engines/overlay/shaders/outline_prepass_geom.glsl +++ b/source/blender/draw/engines/overlay/shaders/outline_prepass_geom.glsl @@ -40,7 +40,7 @@ void main() /* Don't outline if concave edge. */ /* That would hide a lot of non useful edge but it flickers badly. - * TODO revisit later... */ + * TODO: revisit later... */ // if (dot(n0, v13) > 0.01) // return; diff --git a/source/blender/draw/engines/overlay/shaders/paint_point_vert.glsl b/source/blender/draw/engines/overlay/shaders/paint_point_vert.glsl index 9d102bd4295..052ad2a7f36 100644 --- a/source/blender/draw/engines/overlay/shaders/paint_point_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/paint_point_vert.glsl @@ -14,7 +14,7 @@ void main() vec3 world_pos = point_object_to_world(pos); gl_Position = point_world_to_ndc(world_pos); /* Add offset in Z to avoid zfighting and render selected wires on top. */ - /* TODO scale this bias using znear and zfar range. */ + /* TODO: scale this bias using znear and zfar range. */ gl_Position.z -= (is_select ? 2e-4 : 1e-4); if (is_hidden) { diff --git a/source/blender/draw/engines/overlay/shaders/paint_wire_vert.glsl b/source/blender/draw/engines/overlay/shaders/paint_wire_vert.glsl index d5a42d2d309..6a937d846c4 100644 --- a/source/blender/draw/engines/overlay/shaders/paint_wire_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/paint_wire_vert.glsl @@ -16,7 +16,7 @@ void main() vec3 world_pos = point_object_to_world(pos); gl_Position = point_world_to_ndc(world_pos); /* Add offset in Z to avoid zfighting and render selected wires on top. */ - /* TODO scale this bias using znear and zfar range. */ + /* TODO: scale this bias using znear and zfar range. */ gl_Position.z -= (is_select ? 2e-4 : 1e-4); if (is_hidden) { diff --git a/source/blender/draw/engines/overlay/shaders/volume_velocity_vert.glsl b/source/blender/draw/engines/overlay/shaders/volume_velocity_vert.glsl index 0b827601f8e..174b31b6816 100644 --- a/source/blender/draw/engines/overlay/shaders/volume_velocity_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/volume_velocity_vert.glsl @@ -33,7 +33,7 @@ const vec3 corners[4] = vec3[4](vec3(0.0, 0.2, -0.5), const int indices[12] = int[12](0, 1, 1, 2, 2, 0, 0, 3, 1, 3, 2, 3); /* Straight Port from BKE_defvert_weight_to_rgb() - * TODO port this to a color ramp. */ + * TODO: port this to a color ramp. */ vec3 weight_to_color(float weight) { vec3 r_rgb = vec3(0.0); |