Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/workbench/workbench_data.c
| Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | void workbench_private_data_init(WORKBENCH_PrivateData *wpd) | ||||
| /* Clamp to avoid overshadowing and shading errors. */ | /* Clamp to avoid overshadowing and shading errors. */ | ||||
| CLAMP(shadow_focus, 0.0001f, 0.99999f); | CLAMP(shadow_focus, 0.0001f, 0.99999f); | ||||
| wpd->shadow_shift = scene->display.shadow_shift; | wpd->shadow_shift = scene->display.shadow_shift; | ||||
| wpd->shadow_focus = 1.0f - shadow_focus * (1.0f - wpd->shadow_shift); | wpd->shadow_focus = 1.0f - shadow_focus * (1.0f - wpd->shadow_shift); | ||||
| wpd->shadow_multiplier = 1.0 - wpd->shading.shadow_intensity; | wpd->shadow_multiplier = 1.0 - wpd->shading.shadow_intensity; | ||||
| WORKBENCH_UBO_World *wd = &wpd->world_data; | WORKBENCH_UBO_World *wd = &wpd->world_data; | ||||
| wd->matcap_orientation = (wpd->shading.flag & V3D_SHADING_MATCAP_FLIP_X) != 0; | wd->matcap_orientation = (wpd->shading.flag & V3D_SHADING_MATCAP_FLIP_X) != 0; | ||||
| wd->background_alpha = (DRW_state_is_image_render() && scene->r.alphamode == R_ALPHAPREMUL) ? | wd->background_alpha = DRW_state_draw_background() ? 1.0f : 0.0f; | ||||
| 0.0f : | |||||
| 1.0f; | |||||
| if ((scene->world != NULL) && | if ((scene->world != NULL) && | ||||
| (!v3d || (v3d && ((v3d->shading.background_type == V3D_SHADING_BACKGROUND_WORLD) || | (!v3d || (v3d && ((v3d->shading.background_type == V3D_SHADING_BACKGROUND_WORLD) || | ||||
| (v3d->shading.type == OB_RENDER))))) { | (v3d->shading.type == OB_RENDER))))) { | ||||
| copy_v3_v3(wd->background_color_low, &scene->world->horr); | copy_v3_v3(wd->background_color_low, &scene->world->horr); | ||||
| copy_v3_v3(wd->background_color_high, &scene->world->horr); | copy_v3_v3(wd->background_color_high, &scene->world->horr); | ||||
| } | } | ||||
| else if (v3d && (v3d->shading.background_type == V3D_SHADING_BACKGROUND_VIEWPORT)) { | else if (v3d && (v3d->shading.background_type == V3D_SHADING_BACKGROUND_VIEWPORT)) { | ||||
| ▲ Show 20 Lines • Show All 142 Lines • Show Last 20 Lines | |||||