Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/draw_cache_impl_mesh.c
| Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | |||||
| #include "BKE_editmesh.h" | #include "BKE_editmesh.h" | ||||
| #include "BKE_editmesh_cache.h" | #include "BKE_editmesh_cache.h" | ||||
| #include "BKE_editmesh_tangent.h" | #include "BKE_editmesh_tangent.h" | ||||
| #include "BKE_mesh.h" | #include "BKE_mesh.h" | ||||
| #include "BKE_mesh_runtime.h" | #include "BKE_mesh_runtime.h" | ||||
| #include "BKE_mesh_tangent.h" | #include "BKE_mesh_tangent.h" | ||||
| #include "BKE_modifier.h" | #include "BKE_modifier.h" | ||||
| #include "BKE_object_deform.h" | #include "BKE_object_deform.h" | ||||
| #include "BKE_paint.h" | |||||
| #include "BKE_pbvh.h" | |||||
| #include "atomic_ops.h" | #include "atomic_ops.h" | ||||
| #include "bmesh.h" | #include "bmesh.h" | ||||
| #include "GPU_batch.h" | #include "GPU_batch.h" | ||||
| #include "GPU_material.h" | #include "GPU_material.h" | ||||
| ▲ Show 20 Lines • Show All 1,243 Lines • ▼ Show 20 Lines | #endif | ||||
| /* Second chance to early out */ | /* Second chance to early out */ | ||||
| if ((batch_requested & ~cache->batch_ready) == 0) { | if ((batch_requested & ~cache->batch_ready) == 0) { | ||||
| #ifdef DEBUG | #ifdef DEBUG | ||||
| drw_mesh_batch_cache_check_available(task_graph, me); | drw_mesh_batch_cache_check_available(task_graph, me); | ||||
| #endif | #endif | ||||
| return; | return; | ||||
| } | } | ||||
| /* TODO(pablodp606): This always updates the sculpt normals for regular drawing (non-PBVH). | |||||
| * This makes tools that sample the surface per step get wrong normals until a redraw happens. | |||||
| * Normal updates should be part of the brush loop and only run during the stroke when the | |||||
| * brush needs to sample the surface. The drawing code should only update the normals | |||||
| * per redraw when smooth shading is enabled. */ | |||||
| const bool do_update_sculpt_normals = ob->sculpt && ob->sculpt->pbvh; | |||||
| if (do_update_sculpt_normals) { | |||||
| Mesh *mesh = ob->data; | |||||
| BKE_pbvh_update_normals(ob->sculpt->pbvh, mesh->runtime.subdiv_ccg); | |||||
| } | |||||
| cache->batch_ready |= batch_requested; | cache->batch_ready |= batch_requested; | ||||
| const bool do_cage = (is_editmode && | const bool do_cage = (is_editmode && | ||||
| (me->edit_mesh->mesh_eval_final != me->edit_mesh->mesh_eval_cage)); | (me->edit_mesh->mesh_eval_final != me->edit_mesh->mesh_eval_cage)); | ||||
| const bool do_uvcage = is_editmode && !me->edit_mesh->mesh_eval_final->runtime.is_original; | const bool do_uvcage = is_editmode && !me->edit_mesh->mesh_eval_final->runtime.is_original; | ||||
| MeshBufferCache *mbufcache = &cache->final; | MeshBufferCache *mbufcache = &cache->final; | ||||
| ▲ Show 20 Lines • Show All 255 Lines • Show Last 20 Lines | |||||