[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17490] branches/sim_physics/source/ blender/render/intern/source: * Exclude volume materials from AO
Matt Ebb
matt at mke3.net
Tue Nov 18 02:53:52 CET 2008
Revision: 17490
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17490
Author: broken
Date: 2008-11-18 02:53:52 +0100 (Tue, 18 Nov 2008)
Log Message:
-----------
* Exclude volume materials from AO
Modified Paths:
--------------
branches/sim_physics/source/blender/render/intern/source/occlusion.c
branches/sim_physics/source/blender/render/intern/source/rayshade.c
Modified: branches/sim_physics/source/blender/render/intern/source/occlusion.c
===================================================================
--- branches/sim_physics/source/blender/render/intern/source/occlusion.c 2008-11-18 01:01:31 UTC (rev 17489)
+++ branches/sim_physics/source/blender/render/intern/source/occlusion.c 2008-11-18 01:53:52 UTC (rev 17490)
@@ -663,7 +663,7 @@
if((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak;
else vlr++;
- if(vlr->mat->mode & MA_TRACEBLE) {
+ if((vlr->mat->mode & MA_TRACEBLE) && (vlr->mat->material_type == MA_SOLID)) {
tree->face[b].obi= c;
tree->face[b].facenr= a;
tree->occlusion[b]= 1.0f;
Modified: branches/sim_physics/source/blender/render/intern/source/rayshade.c
===================================================================
--- branches/sim_physics/source/blender/render/intern/source/rayshade.c 2008-11-18 01:01:31 UTC (rev 17489)
+++ branches/sim_physics/source/blender/render/intern/source/rayshade.c 2008-11-18 01:53:52 UTC (rev 17490)
@@ -96,6 +96,17 @@
return (is->lay & obi->lay);
}
+static int vlr_check_intersect_solid(Isect *is, int ob, RayFace *face)
+{
+ VlakRen *vlr = (VlakRen*)face;
+
+ /* solid material types only */
+ if (vlr->mat->material_type == MA_SOLID)
+ return 1;
+ else
+ return 0;
+}
+
static float *vlr_get_transform(void *userdata, int i)
{
ObjectInstanceRen *obi= RAY_OBJECT_GET((Render*)userdata, i);
@@ -1621,7 +1632,7 @@
prev = fac;
- if(RE_ray_tree_intersect(R.raytree, &isec)) {
+ if(RE_ray_tree_intersect_check(R.raytree, &isec, vlr_check_intersect_solid)) {
if (R.wrld.aomode & WO_AODIST) fac+= exp(-isec.labda*R.wrld.aodistfac);
else fac+= 1.0f;
}
@@ -1746,7 +1757,7 @@
isec.end[2] = shi->co[2] - maxdist*vec[2];
/* do the trace */
- if(RE_ray_tree_intersect(R.raytree, &isec)) {
+ if(RE_ray_tree_intersect_check(R.raytree, &isec, vlr_check_intersect_solid)) {
if (R.wrld.aomode & WO_AODIST) sh+= exp(-isec.labda*R.wrld.aodistfac);
else sh+= 1.0f;
}
More information about the Bf-blender-cvs
mailing list