Refactor the raytracing code to split the tracing and shading parts into

two separate files, raytrace.c and rayshade.c. The tracing code can now
be used separately from the renderer (will be used in a later commit),
and the raytracing acceleration structure can now also be easily replaced,
if someone wants to experiment with that.
This commit is contained in:
2007-07-26 13:38:24 +00:00
parent 534ba14d2b
commit d63da45ca8
8 changed files with 2683 additions and 2492 deletions

View File

@@ -46,7 +46,6 @@ struct Object;
struct MemArena;
struct VertTableNode;
struct VlakTableNode;
struct Octree;
struct GHash;
#define TABLEINITSIZE 1024
@@ -84,16 +83,6 @@ typedef struct RenderPart
char *clipflag; /* clipflags for part zbuffering */
} RenderPart;
typedef struct Octree {
struct Branch **adrbranch;
struct Node **adrnode;
float ocsize; /* ocsize: mult factor, max size octree */
float ocfacx,ocfacy,ocfacz;
float min[3], max[3];
int ocres;
int branchcount, nodecount;
} Octree;
/* controls state of render, everything that's read-only during render stage */
struct Render
{
@@ -150,7 +139,7 @@ struct Render
ListBase parts;
/* octree tables and variables for raytrace */
Octree oc;
void *raytree;
/* use this instead of R.r.cfra */
float cfra;

View File

@@ -91,8 +91,8 @@ void zbufshade_sss_tile(struct RenderPart *pa);
/* -------- ray.c ------- */
extern void freeoctree(Render *re);
extern void makeoctree(Render *re);
extern void freeraytree(Render *re);
extern void makeraytree(Render *re);
extern void ray_shadow(ShadeInput *, LampRen *, float *);
extern void ray_trace(ShadeInput *, ShadeResult *);