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
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2014-08-12 15:49:27 +0400
committerAntony Riakiotakis <kalast@gmail.com>2014-08-12 15:49:45 +0400
commitba345bcbb6de5f32ba8ae3e9666077c707d10764 (patch)
tree3732eee5bcf15bbca42f82d9facb8e58c552b3ee /source/blender/editors/space_view3d
parent794277f8b6ca5f48eb994560d201e210e1eabaf1 (diff)
Fix T41414, T41386.
There were a few issues to fix here: * We did not really unpremultiply float image dabs prior to sending them to the GPU. That made float and byte image result different in texture painting and undoing could change the result. * To make textures nicely composited over the mesh, I used decal mode in OpenGL texture environment for the texture unit. This uses the texture's alpha channel with a nice over operator. * Texture creation used to override the alpha setting due to the display restrictions. Not so anymore, people can now create transparent byte images. Also, made alpha zero default for new textures now, since it has such a nice effect here.
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r--source/blender/editors/space_view3d/drawmesh.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c
index 89babf977e1..e571584a10f 100644
--- a/source/blender/editors/space_view3d/drawmesh.c
+++ b/source/blender/editors/space_view3d/drawmesh.c
@@ -303,11 +303,13 @@ static bool set_draw_settings_cached(int clearcache, MTFace *texface, Material *
c_badtex = false;
if (GPU_verify_image(ima, NULL, 0, 1, 0, false)) {
glEnable(GL_TEXTURE_2D);
+ glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
}
else {
c_badtex = true;
GPU_clear_tpage(true);
glDisable(GL_TEXTURE_2D);
+ glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glBindTexture(GL_TEXTURE_2D, 0);
}
}
@@ -437,7 +439,8 @@ static void draw_textured_end(void)
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glBindTexture(GL_TEXTURE_2D, 0);
glActiveTexture(GL_TEXTURE0);
- }
+ }
+ glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
/* manual reset, since we don't use tpage */
glBindTexture(GL_TEXTURE_2D, 0);
/* force switch off textures */