Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_draw.c
| Show First 20 Lines • Show All 787 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| static void view3d_draw_background_none(void) | static void view3d_draw_background_none(void) | ||||
| { | { | ||||
| UI_ThemeClearColorAlpha(TH_HIGH_GRAD, 1.0f); | UI_ThemeClearColorAlpha(TH_HIGH_GRAD, 1.0f); | ||||
| glClear(GL_COLOR_BUFFER_BIT); | glClear(GL_COLOR_BUFFER_BIT); | ||||
| } | } | ||||
| static void view3d_draw_background_world(Scene *scene, View3D *v3d, RegionView3D *rv3d) | static void view3d_draw_background_world(Scene *scene, RegionView3D *rv3d) | ||||
| { | { | ||||
| if (scene->world) { | if (scene->world) { | ||||
| GPUMaterial *gpumat = GPU_material_world(scene, scene->world); | GPUMaterial *gpumat = GPU_material_world(scene, scene->world); | ||||
| /* calculate full shader for background */ | /* calculate full shader for background */ | ||||
| GPU_material_bind(gpumat, 1, 1, 1.0f, false, rv3d->viewmat, rv3d->viewinv, rv3d->viewcamtexcofac, (v3d->scenelock != 0)); | GPU_material_bind(gpumat, 1, 1, 1.0f, false, rv3d->viewmat, rv3d->viewinv, rv3d->viewcamtexcofac); | ||||
| if (GPU_material_bound(gpumat)) { | if (GPU_material_bound(gpumat)) { | ||||
| /* TODO viewport (dfelinto): GPU_material_bind relies on immediate mode, | /* TODO viewport (dfelinto): GPU_material_bind relies on immediate mode, | ||||
| * we can't get rid of the following code without a bigger refactor | * we can't get rid of the following code without a bigger refactor | ||||
| * or we dropping this functionality. */ | * or we dropping this functionality. */ | ||||
| glBegin(GL_TRIANGLE_STRIP); | glBegin(GL_TRIANGLE_STRIP); | ||||
| glVertex2f(-1.0f, -1.0f); | glVertex2f(-1.0f, -1.0f); | ||||
| ▲ Show 20 Lines • Show All 1,133 Lines • ▼ Show 20 Lines | |||||
| /* | /* | ||||
| * Function to clear the view | * Function to clear the view | ||||
| */ | */ | ||||
| static void view3d_main_region_clear(Scene *scene, View3D *v3d, ARegion *ar) | static void view3d_main_region_clear(Scene *scene, View3D *v3d, ARegion *ar) | ||||
| { | { | ||||
| glClear(GL_DEPTH_BUFFER_BIT); | glClear(GL_DEPTH_BUFFER_BIT); | ||||
| if (scene->world && (v3d->flag3 & V3D_SHOW_WORLD)) { | if (scene->world && (v3d->flag3 & V3D_SHOW_WORLD)) { | ||||
| VP_view3d_draw_background_world(scene, v3d, ar->regiondata); | VP_view3d_draw_background_world(scene, ar->regiondata); | ||||
| } | } | ||||
| else { | else { | ||||
| VP_view3d_draw_background_none(); | VP_view3d_draw_background_none(); | ||||
| } | } | ||||
| } | } | ||||
| /* ED_view3d_draw_offscreen_init should be called before this to initialize | /* ED_view3d_draw_offscreen_init should be called before this to initialize | ||||
| * stuff like shadow buffers | * stuff like shadow buffers | ||||
| ▲ Show 20 Lines • Show All 428 Lines • ▼ Show 20 Lines | void VP_view3d_draw_background_none(void) | ||||
| if (UI_GetThemeValue(TH_SHOW_BACK_GRAD)) { | if (UI_GetThemeValue(TH_SHOW_BACK_GRAD)) { | ||||
| view3d_draw_background_gradient(); | view3d_draw_background_gradient(); | ||||
| } | } | ||||
| else { | else { | ||||
| view3d_draw_background_none(); | view3d_draw_background_none(); | ||||
| } | } | ||||
| } | } | ||||
| void VP_view3d_draw_background_world(Scene *scene, View3D *v3d, RegionView3D *rv3d) | void VP_view3d_draw_background_world(Scene *scene, RegionView3D *rv3d) | ||||
| { | { | ||||
| view3d_draw_background_world(scene, v3d, rv3d); | view3d_draw_background_world(scene, rv3d); | ||||
| } | } | ||||
| void VP_view3d_main_region_clear(Scene *scene, View3D *v3d, ARegion *ar) | void VP_view3d_main_region_clear(Scene *scene, View3D *v3d, ARegion *ar) | ||||
| { | { | ||||
| view3d_main_region_clear(scene, v3d, ar); | view3d_main_region_clear(scene, v3d, ar); | ||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||