Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/workbench/workbench_data.c
| Show First 20 Lines • Show All 115 Lines • ▼ Show 20 Lines | void workbench_private_data_init(WORKBENCH_PrivateData *wpd) | ||||
| copy_v3_v3(wd->object_outline_color, wpd->shading.object_outline_color); | copy_v3_v3(wd->object_outline_color, wpd->shading.object_outline_color); | ||||
| wd->object_outline_color[3] = 1.0f; | wd->object_outline_color[3] = 1.0f; | ||||
| wd->curvature_ridge = 0.5f / max_ff(SQUARE(wpd->shading.curvature_ridge_factor), 1e-4f); | wd->curvature_ridge = 0.5f / max_ff(SQUARE(wpd->shading.curvature_ridge_factor), 1e-4f); | ||||
| wd->curvature_valley = 0.7f / max_ff(SQUARE(wpd->shading.curvature_valley_factor), 1e-4f); | wd->curvature_valley = 0.7f / max_ff(SQUARE(wpd->shading.curvature_valley_factor), 1e-4f); | ||||
| /* Will be NULL when rendering. */ | /* Will be NULL when rendering. */ | ||||
| if (draw_ctx->rv3d != NULL) { | if (DRW_state_is_clipping_enabled()) { | ||||
| RegionView3D *rv3d = draw_ctx->rv3d; | RegionView3D *rv3d = draw_ctx->rv3d; | ||||
| if (rv3d->rflag & RV3D_CLIPPING) { | |||||
| wpd->world_clip_planes = rv3d->clip; | wpd->world_clip_planes = rv3d->clip; | ||||
| UI_GetThemeColor4fv(TH_V3D_CLIPPING_BORDER, wpd->world_clip_planes_color); | UI_GetThemeColor4fv(TH_V3D_CLIPPING_BORDER, wpd->world_clip_planes_color); | ||||
| if (wpd->use_color_management) { | if (wpd->use_color_management) { | ||||
| srgb_to_linearrgb_v3_v3(wpd->world_clip_planes_color, wpd->world_clip_planes_color); | srgb_to_linearrgb_v3_v3(wpd->world_clip_planes_color, wpd->world_clip_planes_color); | ||||
| } | } | ||||
| else { | else { | ||||
| copy_v3_v3(wpd->world_clip_planes_color, wpd->world_clip_planes_color); | copy_v3_v3(wpd->world_clip_planes_color, wpd->world_clip_planes_color); | ||||
| } | } | ||||
fclem: is that ok during rendering? | |||||
Done Inline ActionsYes, RV3D_CLIPPING_ENABLED does the NULL checks. jbakker: Yes, `RV3D_CLIPPING_ENABLED` does the NULL checks. | |||||
| } | } | ||||
| else { | else { | ||||
| wpd->world_clip_planes = NULL; | wpd->world_clip_planes = NULL; | ||||
| } | } | ||||
| } | |||||
| wpd->world_ubo = DRW_uniformbuffer_create(sizeof(WORKBENCH_UBO_World), &wpd->world_data); | wpd->world_ubo = DRW_uniformbuffer_create(sizeof(WORKBENCH_UBO_World), &wpd->world_data); | ||||
| /* Cavity settings */ | /* Cavity settings */ | ||||
| { | { | ||||
| const int ssao_samples = scene->display.matcap_ssao_samples; | const int ssao_samples = scene->display.matcap_ssao_samples; | ||||
| float invproj[4][4]; | float invproj[4][4]; | ||||
| ▲ Show 20 Lines • Show All 85 Lines • Show Last 20 Lines | |||||
is that ok during rendering?