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:
@@ -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;
|
||||
|
||||
@@ -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 *);
|
||||
|
||||
Reference in New Issue
Block a user