Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/basic/basic_engine.c
| Show All 19 Lines | |||||
| * \ingroup draw_engine | * \ingroup draw_engine | ||||
| * | * | ||||
| * Simple engine for drawing color and/or depth. | * Simple engine for drawing color and/or depth. | ||||
| * When we only need simple flat shaders. | * When we only need simple flat shaders. | ||||
| */ | */ | ||||
| #include "DRW_render.h" | #include "DRW_render.h" | ||||
| #include "BKE_paint.h" | |||||
| #include "BKE_particle.h" | #include "BKE_particle.h" | ||||
| #include "DNA_particle_types.h" | #include "DNA_particle_types.h" | ||||
| #include "GPU_shader.h" | #include "GPU_shader.h" | ||||
| #include "basic_engine.h" | #include "basic_engine.h" | ||||
| /* Shaders */ | /* Shaders */ | ||||
| ▲ Show 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | if (is_flat_object_viewed_from_side) { | ||||
| struct GPUBatch *geom = DRW_cache_object_all_edges_get(ob); | struct GPUBatch *geom = DRW_cache_object_all_edges_get(ob); | ||||
| if (geom) { | if (geom) { | ||||
| DRW_shgroup_call(stl->g_data->depth_shgrp, geom, ob); | DRW_shgroup_call(stl->g_data->depth_shgrp, geom, ob); | ||||
| } | } | ||||
| return; | return; | ||||
| } | } | ||||
| } | } | ||||
| const bool use_sculpt_pbvh = BKE_sculptsession_use_pbvh_draw(ob, draw_ctx->v3d); | |||||
| if (use_sculpt_pbvh) { | |||||
| DRW_shgroup_call_sculpt(stl->g_data->depth_shgrp, ob, false, false, false); | |||||
| } | |||||
| else { | |||||
| struct GPUBatch *geom = DRW_cache_object_surface_get(ob); | struct GPUBatch *geom = DRW_cache_object_surface_get(ob); | ||||
| if (geom) { | if (geom) { | ||||
| const bool do_cull = (draw_ctx->v3d && | const bool do_cull = (draw_ctx->v3d && | ||||
| (draw_ctx->v3d->shading.flag & V3D_SHADING_BACKFACE_CULLING)); | (draw_ctx->v3d->shading.flag & V3D_SHADING_BACKFACE_CULLING)); | ||||
| /* Depth Prepass */ | /* Depth Prepass */ | ||||
| DRW_shgroup_call( | DRW_shgroup_call( | ||||
| (do_cull) ? stl->g_data->depth_shgrp_cull : stl->g_data->depth_shgrp, geom, ob); | (do_cull) ? stl->g_data->depth_shgrp_cull : stl->g_data->depth_shgrp, geom, ob); | ||||
| } | } | ||||
| } | } | ||||
| } | |||||
| static void basic_cache_finish(void *vedata) | static void basic_cache_finish(void *vedata) | ||||
| { | { | ||||
| BASIC_StorageList *stl = ((BASIC_Data *)vedata)->stl; | BASIC_StorageList *stl = ((BASIC_Data *)vedata)->stl; | ||||
| UNUSED_VARS(stl); | UNUSED_VARS(stl); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines | |||||