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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-10-15 19:56:00 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-10-15 19:56:00 +0400
commitf7a38811750237a05baeac58246482d409f0ab83 (patch)
treeb35a31eb151639d2641c908be750dae40d927704 /source/blender/editors/space_view3d/drawmesh.c
parent70efa7f1aa43d3f35b614a94c493e89d51272d42 (diff)
3D view: textured draw mode now has a Shadeless option in the Shading panel,
to draw textures without shading. For Cycles this was not possible yet, and for Blender Internal you had to move away all lights which was also not ideal. (Caminandes feature request)
Diffstat (limited to 'source/blender/editors/space_view3d/drawmesh.c')
-rw-r--r--source/blender/editors/space_view3d/drawmesh.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c
index 269b9247c81..dc62005f760 100644
--- a/source/blender/editors/space_view3d/drawmesh.c
+++ b/source/blender/editors/space_view3d/drawmesh.c
@@ -345,7 +345,10 @@ static void draw_textured_begin(Scene *scene, View3D *v3d, RegionView3D *rv3d, O
else {
/* draw with lights in the scene otherwise */
solidtex = false;
- Gtexdraw.is_lit = GPU_scene_object_lights(scene, ob, v3d->lay, rv3d->viewmat, !rv3d->is_persp);
+ if(v3d->flag2 & V3D_SHADELESS_TEX)
+ Gtexdraw.is_lit = 0;
+ else
+ Gtexdraw.is_lit = GPU_scene_object_lights(scene, ob, v3d->lay, rv3d->viewmat, !rv3d->is_persp);
}
rgba_float_to_uchar(obcol, ob->col);
@@ -955,7 +958,10 @@ void draw_mesh_textured(Scene *scene, View3D *v3d, RegionView3D *rv3d,
if (ob->transflag & OB_NEG_SCALE) glFrontFace(GL_CW);
else glFrontFace(GL_CCW);
- glEnable(GL_LIGHTING);
+ if ((v3d->drawtype == OB_TEXTURE) && (v3d->flag2 & V3D_SHADELESS_TEX))
+ glColor3f(1.0f, 1.0f, 1.0f);
+ else
+ glEnable(GL_LIGHTING);
{
Mesh *me = ob->data;