From f25d2dbb411a2eb6095a53893759a3fc29904ffd Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 28 Jan 2008 16:54:52 +0000 Subject: Strands now mix together correctly with ZTransp. They now also store a list of samples per pixel, and then get shaded together with the ztransp samples. This comes with a slight speed hit, but mainly memory might be a concern. However, testing some peach scenes I haven't problems. --- source/blender/render/intern/include/zbuf.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'source/blender/render/intern/include/zbuf.h') diff --git a/source/blender/render/intern/include/zbuf.h b/source/blender/render/intern/include/zbuf.h index 8feb18a7ab8..2a16bde829b 100644 --- a/source/blender/render/intern/include/zbuf.h +++ b/source/blender/render/intern/include/zbuf.h @@ -36,6 +36,8 @@ struct LampRen; struct VlakRen; struct ListBase; struct ZSpan; +struct APixstrand; +struct StrandShadeCache; void fillrect(int *rect, int x, int y, int val); @@ -51,9 +53,9 @@ void zbuffer_shadow(struct Render *re, float winmat[][4], struct LampRen *lar, i void zbuffer_solid(struct RenderPart *pa, struct RenderLayer *rl, void (*fillfunc)(struct RenderPart*, struct ZSpan*, int, void*), void *data); unsigned short *zbuffer_transp_shade(struct RenderPart *pa, struct RenderLayer *rl, float *pass, struct ListBase *psmlist); -unsigned short *zbuffer_strands_shade(struct Render *re, struct RenderPart *pa, struct RenderLayer *rl, float *pass); void convert_zbuf_to_distbuf(struct RenderPart *pa, struct RenderLayer *rl); void zbuffer_sss(RenderPart *pa, unsigned int lay, void *handle, void (*func)(void*, int, int, int, int, int)); +int zbuffer_strands_abuf(struct Render *re, struct RenderPart *pa, struct RenderLayer *rl, struct APixstrand *apixbuf, struct ListBase *apsmbase, struct StrandShadeCache *cache); typedef struct APixstr { unsigned short mask[4]; /* jitter mask */ @@ -64,10 +66,20 @@ typedef struct APixstr { struct APixstr *next; } APixstr; +typedef struct APixstrand { + unsigned short mask[4]; /* jitter mask */ + int z[4]; /* distance */ + int p[4]; /* index */ + int obi[4]; /* object instance */ + int seg[4]; /* for strands, segment number */ + float u[4], v[4]; /* for strands, u,v coordinate in segment */ + struct APixstrand *next; +} APixstrand; + typedef struct APixstrMain { struct APixstrMain *next, *prev; - struct APixstr *ps; + void *ps; } APixstrMain; /* span fill in method, is also used to localize data for zbuffering */ @@ -85,11 +97,13 @@ typedef struct ZSpan { int *rectp; /* polygon index buffer */ int *recto; /* object buffer */ APixstr *apixbuf, *curpstr; /* apixbuf for transparent */ + APixstrand *curpstrand; /* same for strands */ struct ListBase *apsmbase; int polygon_offset; /* offset in Z */ float shad_alpha; /* copy from material, used by irregular shadbuf */ int mask, apsmcounter; /* in use by apixbuf */ + int apstrandmcounter; float clipcrop; /* for shadow, was in R global before */ -- cgit v1.2.3