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:
authorSergey Sharybin <sergey.vfx@gmail.com>2013-09-17 18:20:00 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-09-17 18:20:00 +0400
commit07306c5f9c12fc9a43cc49a716ebb54c40a2093d (patch)
treeca549ea4122b98a89695094f4e9a618753147991 /source/blender/editors/space_view3d/drawobject.c
parentdaa87ff0b4a0366e5e4bd4fa750ab0fbc455a61a (diff)
Fix #36718: Wrong lighting on text objects
In fact, all curve objects were flipped in GLSL mode. This is because of the way how normals are calculated for them (inwards vs. outwards). We might want to make normals consistent all over, but that would be the bigger change. For ow just made some tweaks to OpenGL setup. Thanks Brecht for the review and tests!
Diffstat (limited to 'source/blender/editors/space_view3d/drawobject.c')
-rw-r--r--source/blender/editors/space_view3d/drawobject.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 49ec47d651f..23b80fc5bea 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -3803,12 +3803,16 @@ static void drawDispListsolid(ListBase *lb, Object *ob, const short dflag,
glEnable(GL_LIGHTING);
glEnableClientState(GL_VERTEX_ARRAY);
- if (ob->transflag & OB_NEG_SCALE) glFrontFace(GL_CW);
- else glFrontFace(GL_CCW);
if (ob->type == OB_MBALL) { /* mball always smooth shaded */
+ if (ob->transflag & OB_NEG_SCALE) glFrontFace(GL_CW);
+ else glFrontFace(GL_CCW);
glShadeModel(GL_SMOOTH);
}
+ else {
+ if (ob->transflag & OB_NEG_SCALE) glFrontFace(GL_CCW);
+ else glFrontFace(GL_CW);
+ }
dl = lb->first;
while (dl) {
@@ -4090,7 +4094,7 @@ static bool drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *ba
if (v3d->flag2 & V3D_BACKFACE_CULLING) {
/* not all displists use same in/out normal direction convention */
glEnable(GL_CULL_FACE);
- glCullFace((base->object->type == OB_MBALL || base->object->derivedFinal) ? GL_BACK : GL_FRONT);
+ glCullFace(GL_BACK);
}
retval = drawDispList_nobackface(scene, v3d, rv3d, base, dt, dflag, ob_wire_col);