Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2015-03-10 18:34:40 +0300
committerAntony Riakiotakis <kalast@gmail.com>2015-03-10 18:47:50 +0300
commit56c0a3faef74658fec4769d986253023958e6c36 (patch)
treecaba5900bf059671e6c7013bb0d413b2a1cabc74 /source
parentedc8a4c4847e3ea3a58683926c22b519d2af830c (diff)
Fix T43953, make opengl render work like before, basically, if we render
transparent, it will render sky/transparent, regardless of the "show world setting".
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/include/UI_resources.h3
-rw-r--r--source/blender/editors/interface/resources.c8
-rw-r--r--source/blender/editors/render/render_opengl.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c16
4 files changed, 19 insertions, 10 deletions
diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h
index 4a6d9911d3b..4a484212a63 100644
--- a/source/blender/editors/include/UI_resources.h
+++ b/source/blender/editors/include/UI_resources.h
@@ -361,6 +361,9 @@ void UI_GetColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned
// clear the openGL ClearColor using the input colorid
void UI_ThemeClearColor(int colorid);
+// clear the openGL ClearColor using the input colorid using optional transparency
+void UI_ThemeClearColorAlpha(int colorid, float alpha);
+
// internal (blender) usage only, for init and set active
void UI_SetTheme(int spacetype, int regionid);
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index ab237e78c26..a9cc53852c0 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -1531,6 +1531,14 @@ void UI_ThemeClearColor(int colorid)
glClearColor(col[0], col[1], col[2], 0.0f);
}
+void UI_ThemeClearColorAlpha(int colorid, float alpha)
+{
+ float col[3];
+ UI_GetThemeColor3fv(colorid, col);
+ glClearColor(col[0], col[1], col[2], alpha);
+}
+
+
int UI_ThemeMenuShadowWidth(void)
{
bTheme *btheme = UI_GetTheme();
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c
index d5cf7dd755a..402e72db217 100644
--- a/source/blender/editors/render/render_opengl.c
+++ b/source/blender/editors/render/render_opengl.c
@@ -136,7 +136,7 @@ static void screen_opengl_render_apply(OGLRender *oglrender)
int sizey = oglrender->sizey;
const short view_context = (v3d != NULL);
bool draw_bgpic = true;
- bool draw_sky = (scene->r.alphamode == R_ADDSKY) && v3d && (v3d->flag3 & V3D_SHOW_WORLD);
+ bool draw_sky = (scene->r.alphamode == R_ADDSKY);
unsigned char *rect = NULL;
rr = RE_AcquireResultRead(oglrender->re);
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 8e516e1ea0e..7b3f8697ccd 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -2879,11 +2879,9 @@ void ED_view3d_draw_offscreen_init(Scene *scene, View3D *v3d)
/*
* Function to clear the view
*/
-static void view3d_main_area_clear(Scene *scene, View3D *v3d, ARegion *ar, bool force)
+static void view3d_main_area_clear(Scene *scene, View3D *v3d, ARegion *ar)
{
- /* clear background */
- if (scene->world && ((v3d->flag3 & V3D_SHOW_WORLD) || force)) {
- float alpha = (force) ? 1.0f : 0.0f;
+ if (scene->world && (v3d->flag3 & V3D_SHOW_WORLD)) {
bool glsl = GPU_glsl_support() && BKE_scene_use_new_shading_nodes(scene) && scene->world->nodetree && scene->world->use_nodes;
if (glsl) {
@@ -2996,7 +2994,7 @@ static void view3d_main_area_clear(Scene *scene, View3D *v3d, ARegion *ar, bool
interp_v3_v3v3(col_fl, col_hor, col_zen, col_fac);
rgb_float_to_uchar(col_ub, col_fl);
- col_ub[3] = alpha * 255;
+ col_ub[3] = 255;
}
}
@@ -3031,7 +3029,7 @@ static void view3d_main_area_clear(Scene *scene, View3D *v3d, ARegion *ar, bool
IMB_colormanagement_pixel_to_display_space_v3(col_hor, &scene->world->horr, &scene->view_settings,
&scene->display_settings);
- glClearColor(col_hor[0], col_hor[1], col_hor[2], alpha);
+ glClearColor(col_hor[0], col_hor[1], col_hor[2], 1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
}
@@ -3067,7 +3065,7 @@ static void view3d_main_area_clear(Scene *scene, View3D *v3d, ARegion *ar, bool
glPopMatrix();
}
else {
- UI_ThemeClearColor(TH_HIGH_GRAD);
+ UI_ThemeClearColorAlpha(TH_HIGH_GRAD, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
}
@@ -3125,7 +3123,7 @@ void ED_view3d_draw_offscreen(
/* clear opengl buffers */
if (do_sky) {
- view3d_main_area_clear(scene, v3d, ar, true);
+ view3d_main_area_clear(scene, v3d, ar);
}
else {
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
@@ -3555,7 +3553,7 @@ static void view3d_main_area_draw_objects(const bContext *C, Scene *scene, View3
}
/* clear the background */
- view3d_main_area_clear(scene, v3d, ar, false);
+ view3d_main_area_clear(scene, v3d, ar);
/* enables anti-aliasing for 3D view drawing */
if (U.ogl_multisamples != USER_MULTISAMPLE_NONE) {