Smoke: no lamp results in no shading (requested by nudelZ)
authorDaniel Genrich <daniel.genrich@gmx.net>
Thu, 13 Aug 2009 21:29:05 +0000 (21:29 +0000)
committerDaniel Genrich <daniel.genrich@gmx.net>
Thu, 13 Aug 2009 21:29:05 +0000 (21:29 +0000)
source/blender/editors/space_view3d/drawobject.c

index 05336d29dc3c78a3bb1d384f839b5d932a05dcfb..3641ff435dd60fb170e2bab541fc3aa6d31b56c6 100644 (file)
@@ -5351,6 +5351,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
                        float bigfactor = 1.0;
                        int big = (smd->domain->flags & MOD_SMOKE_HIGHRES) && (smd->domain->viewsettings & MOD_SMOKE_VIEW_USEBIG);
                        int new = 0;
+                       int have_lamp = 0;
                        
                        // GUI sent redraw event
                        if(smd->domain->flags & MOD_SMOKE_VIEW_REDRAWNICE)
@@ -5439,7 +5440,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
                        
                        if(new > 1)
                        {
-                               float light[3] = {0.0,0.0,2.0}; // TODO: take real LAMP coordinates - dg
+                               float light[3] = {0.0,0.0,0.0}; // TODO: take real LAMP coordinates - dg
                                Base *base_tmp = NULL;
 
                                for(base_tmp = scene->base.first; base_tmp; base_tmp= base_tmp->next) 
@@ -5451,6 +5452,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
                                                if(la->type == LA_LOCAL)
                                                {
                                                        VECCOPY(light, base_tmp->object->obmat[3]);
+                                                       have_lamp = 1;
                                                        break;
                                                }
                                        }
@@ -5554,6 +5556,9 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
                                                                        tvox =  smoke_get_bigtvox(smd, index);
                                                                        tray = smoke_get_bigtray(smd, index);
                                                                }
+
+                                                               if(!have_lamp)
+                                                                       tvox = 1.0;
                                                                
                                                                // fill buffer with luminance and alpha
                                                                // 1 - T_vox