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:
authorMitchell Stokes <mogurijin@gmail.com>2011-08-25 00:28:54 +0400
committerMitchell Stokes <mogurijin@gmail.com>2011-08-25 00:28:54 +0400
commit7fc26e0123e700113f340068a964c1a12133b7e1 (patch)
tree50a81047e60a7b8791181fb877915cee2a641ff2 /source/blender/editors/space_view3d/drawobject.c
parent81a8f3e88592e6a570ab7e2f844c298a320480f5 (diff)
Committing patch #25675 "Make "Cast Buffer Shadows" option work in viewport and BGE" by me.
Description from the tracker: "It's really handy to be able to prevent an object/material from casting a shadow. So, I made use of the Cast Buffer Shadows option in the material settings, and made it work in the viewport and the BGE."
Diffstat (limited to 'source/blender/editors/space_view3d/drawobject.c')
-rw-r--r--source/blender/editors/space_view3d/drawobject.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index ddc10d78cac..3133ad131bb 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -2843,8 +2843,20 @@ static int draw_mesh_object(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
Object *ob= base->object;
Object *obedit= scene->obedit;
Mesh *me= ob->data;
+ Material *ma=NULL;
EditMesh *em= me->edit_mesh;
- int do_alpha_pass= 0, drawlinked= 0, retval= 0, glsl, check_alpha;
+ int do_alpha_pass= 0, drawlinked= 0, retval= 0, glsl, check_alpha, i;
+
+ /* If we are drawing shadows and any of the materials don't cast a shadow, then don't draw the object */
+ if (v3d->flag2 & V3D_RENDER_SHADOW)
+ {
+ for(i=0; i<ob->totcol; ++i)
+ {
+ ma = give_current_material(ob, i);
+ if (ma && !(ma->mode & MA_SHADBUF))
+ return 1;
+ }
+ }
if(obedit && ob!=obedit && ob->data==obedit->data) {
if(ob_get_key(ob) || ob_get_key(obedit));