* reimplemented some things, hopefully may fix some problems zanqdo was having

This commit is contained in:
Matt Ebb
2008-10-21 08:21:36 +00:00
parent 97a7b05068
commit b12d9bfa9c
4 changed files with 8 additions and 12 deletions

View File

@@ -100,7 +100,6 @@ typedef struct ShadeInput
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? */

View File

@@ -467,7 +467,6 @@ static void traceray(ShadeInput *origshi, ShadeResult *origshr, short depth, flo
//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 @@ void ray_trace_shadow_tra(Isect *is, int depth, int traflag)
shi.depth= 1; /* only used to indicate tracing */
shi.mask= 1;
shi.re = &R;
/*shi.osatex= 0;
shi.thread= shi.sample= 0;

View File

@@ -1270,7 +1270,6 @@ void shade_input_initialize(ShadeInput *shi, RenderPart *pa, RenderLayer *rl, in
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 */

View File

@@ -95,7 +95,7 @@ static int vol_always_intersect_check(Isect *is, int ob, RayFace *face)
/* 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 @@ static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco,
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 @@ void vol_get_scattering(ShadeInput *shi, float *scatter, float *co, float stepsi
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 @@ static void shade_intersection(ShadeInput *shi, float *col, Isect *is)
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 shade_intersection(ShadeInput *shi, float *col, Isect *is)
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 @@ static void vol_trace_behind(ShadeInput *shi, VlakRen *vlr, float *co, float *co
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 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m
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 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m
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);