[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17143] branches/sim_physics/source/ blender/render: * reimplemented some things, hopefully may fix some problems zanqdo was having
Matt Ebb
matt at mke3.net
Tue Oct 21 10:21:36 CEST 2008
Revision: 17143
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17143
Author: broken
Date: 2008-10-21 10:21:36 +0200 (Tue, 21 Oct 2008)
Log Message:
-----------
* reimplemented some things, hopefully may fix some problems zanqdo was having
Modified Paths:
--------------
branches/sim_physics/source/blender/render/extern/include/RE_shader_ext.h
branches/sim_physics/source/blender/render/intern/source/rayshade.c
branches/sim_physics/source/blender/render/intern/source/shadeinput.c
branches/sim_physics/source/blender/render/intern/source/volumetric.c
Modified: branches/sim_physics/source/blender/render/extern/include/RE_shader_ext.h
===================================================================
--- branches/sim_physics/source/blender/render/extern/include/RE_shader_ext.h 2008-10-21 08:00:19 UTC (rev 17142)
+++ branches/sim_physics/source/blender/render/extern/include/RE_shader_ext.h 2008-10-21 08:21:36 UTC (rev 17143)
@@ -100,7 +100,6 @@
struct StrandRen *strand;
struct ObjectInstanceRen *obi;
struct ObjectRen *obr;
- struct Render *re; /* link back to the Render */
int facenr;
float facenor[3]; /* copy from face */
short flippednor; /* is facenor flipped? */
Modified: branches/sim_physics/source/blender/render/intern/source/rayshade.c
===================================================================
--- branches/sim_physics/source/blender/render/intern/source/rayshade.c 2008-10-21 08:00:19 UTC (rev 17142)
+++ branches/sim_physics/source/blender/render/intern/source/rayshade.c 2008-10-21 08:21:36 UTC (rev 17143)
@@ -467,7 +467,6 @@
//shi.do_preview= 0; // memset above, so dont need this
shi.light_override= origshi->light_override;
shi.mat_override= origshi->mat_override;
- shi.re = origshi->re;
memset(&shr, 0, sizeof(ShadeResult));
@@ -1301,7 +1300,6 @@
shi.depth= 1; /* only used to indicate tracing */
shi.mask= 1;
- shi.re = &R;
/*shi.osatex= 0;
shi.thread= shi.sample= 0;
Modified: branches/sim_physics/source/blender/render/intern/source/shadeinput.c
===================================================================
--- branches/sim_physics/source/blender/render/intern/source/shadeinput.c 2008-10-21 08:00:19 UTC (rev 17142)
+++ branches/sim_physics/source/blender/render/intern/source/shadeinput.c 2008-10-21 08:21:36 UTC (rev 17143)
@@ -1270,7 +1270,6 @@
shi->combinedflag= ~rl->pass_xor;
shi->mat_override= rl->mat_override;
shi->light_override= rl->light_override;
- shi->re = &R;
// shi->rl= rl;
/* note shi.depth==0 means first hit, not raytracing */
Modified: branches/sim_physics/source/blender/render/intern/source/volumetric.c
===================================================================
--- branches/sim_physics/source/blender/render/intern/source/volumetric.c 2008-10-21 08:00:19 UTC (rev 17142)
+++ branches/sim_physics/source/blender/render/intern/source/volumetric.c 2008-10-21 08:21:36 UTC (rev 17143)
@@ -95,7 +95,7 @@
/* TODO: Box or sphere intersection types could speed things up */
static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, Isect *isect, int intersect_type, int checkfunc)
{
- float maxsize = RE_ray_tree_max_size(shi->re->raytree);
+ float maxsize = RE_ray_tree_max_size(R.raytree);
int intersected=0;
/* TODO: use object's bounding box to calculate max size */
@@ -114,9 +114,9 @@
else if (intersect_type == VOL_BOUNDS_SS) isect->faceorig= NULL;
if (checkfunc==VOL_IS_BACKFACE)
- intersected = RE_ray_tree_intersect_check(shi->re->raytree, isect, vol_backface_intersect_check);
+ intersected = RE_ray_tree_intersect_check(R.raytree, isect, vol_backface_intersect_check);
else
- intersected = RE_ray_tree_intersect(shi->re->raytree, isect);
+ intersected = RE_ray_tree_intersect(R.raytree, isect);
if(intersected)
{
@@ -455,7 +455,7 @@
float col[3] = {0.f, 0.f, 0.f};
int i=0;
- for(go=shi->re->lights.first; go; go= go->next)
+ for(go=R.lights.first; go; go= go->next)
{
float lacol[3] = {0.f, 0.f, 0.f};
@@ -596,7 +596,6 @@
shi_new.combinedflag= 0xFFFFFF; /* ray trace does all options */
shi_new.light_override= shi->light_override;
shi_new.mat_override= shi->mat_override;
- shi_new.re = shi->re;
VECCOPY(shi_new.camera_co, is->start);
@@ -616,7 +615,7 @@
static void vol_trace_behind(ShadeInput *shi, VlakRen *vlr, float *co, float *col)
{
Isect isect;
- float maxsize = RE_ray_tree_max_size(shi->re->raytree);
+ float maxsize = RE_ray_tree_max_size(R.raytree);
VECCOPY(isect.start, co);
isect.end[0] = isect.start[0] + shi->view[0] * maxsize;
@@ -632,7 +631,7 @@
isect.lay= -1;
/* check to see if there's anything behind the volume, otherwise shade the sky */
- if(RE_ray_tree_intersect(shi->re->raytree, &isect)) {
+ if(RE_ray_tree_intersect(R.raytree, &isect)) {
shade_intersection(shi, col, &isect);
} else {
shadeSkyView(col, co, shi->view, NULL);
@@ -865,6 +864,8 @@
float i = 1.0f;
double time, lasttime= PIL_check_seconds_timer();
const int res = ma->vol_precache_resolution;
+
+ R = *re;
/* create a raytree with just the faces of the instanced ObjectRen,
* used for checking if the cached point is inside or outside. */
@@ -882,7 +883,6 @@
shi.obi= obi;
shi.obr= obi->obr;
shi.lay = re->scene->lay;
- shi.re = re;
VECCOPY(shi.view, view);
stepsize = vol_get_stepsize(&shi, STEPSIZE_VIEW);
More information about the Bf-blender-cvs
mailing list