Fix for strand render + simplification + vector blur. With the number

of strands changing between frames, vector blur couldn't work. Now
speed vectors are interpolated from the surface. This also means
child particles don't have to be computed in the previous and next
frames, so saves time too.
This commit is contained in:
2008-01-24 13:11:15 +00:00
parent 18ab78c867
commit 02145966a8
9 changed files with 249 additions and 138 deletions

View File

@@ -45,7 +45,5 @@ void sample_occ(struct Render *re, struct ShadeInput *shi);
void cache_occ_samples(struct Render *re, struct RenderPart *pa, struct ShadeSample *ssamp);
void free_occ_samples(struct Render *re, struct RenderPart *pa);
void *cache_occ_mesh(struct Render *re, struct ObjectRen *obr, struct DerivedMesh *dm, float mat[][4]);
#endif

View File

@@ -161,7 +161,7 @@ struct Render
/* occlusion tree */
void *occlusiontree;
ListBase occlusionmesh;
ListBase strandsurface;
/* use this instead of R.r.cfra */
float cfra;
@@ -337,6 +337,18 @@ typedef struct StrandVert {
float strandco;
} StrandVert;
typedef struct StrandSurface {
struct StrandSurface *next, *prev;
ObjectRen obr;
int (*face)[4];
float (*co)[3];
/* for occlusion caching */
float (*col)[3]; /* for occlusion */
/* for speedvectors */
float (*prevco)[3], (*nextco)[3];
int totvert, totface;
} StrandSurface;
typedef struct StrandBuffer {
struct StrandBuffer *next, *prev;
struct StrandVert *vert;
@@ -344,7 +356,7 @@ typedef struct StrandBuffer {
struct ObjectRen *obr;
struct Material *ma;
void *occlusionmesh;
struct StrandSurface *surface;
unsigned int lay;
int overrideuv;
int flag, maxdepth;

View File

@@ -44,6 +44,9 @@ struct RenderBuckets;
struct RenderPrimitiveIterator;
struct ZSpan;
struct ObjectInstanceRen;
struct StrandSurface;
struct DerivedMesh;
struct ObjectRen;
typedef struct StrandPoint {
/* position within segment */
@@ -89,6 +92,9 @@ void strand_eval_point(StrandSegment *sseg, StrandPoint *spoint);
void render_strand_segment(struct Render *re, float winmat[][4], struct StrandPart *spart, struct ZSpan *zspan, int totzspan, StrandSegment *sseg);
void project_strands(Render *re, void (*projectfunc)(float *, float mat[][4], float *), int do_pano, int do_buckets);
struct StrandSurface *cache_strand_surface(struct Render *re, struct ObjectRen *obr, struct DerivedMesh *dm, float mat[][4], int timeoffset);
void free_strand_surface(struct Render *re);
struct RenderBuckets *init_buckets(struct Render *re);
void add_buckets_primitive(struct RenderBuckets *buckets, float *min, float *max, void *prim);
void free_buckets(struct RenderBuckets *buckets);