[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60201] trunk/blender/source/blender/ editors/space_view3d/drawobject.c: Fix #36718: Wrong lighting on text objects

Sergey Sharybin sergey.vfx at gmail.com
Tue Sep 17 16:20:00 CEST 2013


Revision: 60201
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60201
Author:   nazgul
Date:     2013-09-17 14:20:00 +0000 (Tue, 17 Sep 2013)
Log Message:
-----------
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!

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_view3d/drawobject.c

Modified: trunk/blender/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/drawobject.c	2013-09-17 14:02:13 UTC (rev 60200)
+++ trunk/blender/source/blender/editors/space_view3d/drawobject.c	2013-09-17 14:20:00 UTC (rev 60201)
@@ -3803,12 +3803,16 @@
 	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 @@
 	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);




More information about the Bf-blender-cvs mailing list