diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2007-05-04 01:37:52 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2007-05-04 01:37:52 +0400 |
commit | 3a8c6c81d84f5ee6b7ae7fb8cfcba65736f08908 (patch) | |
tree | 4a2f46b430daa12522db27d465f392f79a6a2e2c /source/blender/render/intern/include | |
parent | 4ec6f1b4e4c5fd379559691307ff776bcda8e10f (diff) |
Subsurface scattering:
Documentation on the settings, known limitations and implementation
info can be found here:
http://www.blender.org/development/current-projects/changes-since-243/subsurface-scattering/
Diffstat (limited to 'source/blender/render/intern/include')
-rw-r--r-- | source/blender/render/intern/include/render_types.h | 17 | ||||
-rw-r--r-- | source/blender/render/intern/include/rendercore.h | 2 | ||||
-rw-r--r-- | source/blender/render/intern/include/sss.h | 65 | ||||
-rw-r--r-- | source/blender/render/intern/include/zbuf.h | 4 |
4 files changed, 85 insertions, 3 deletions
diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index 609c391d599..45aff8e8b60 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -68,9 +68,12 @@ typedef struct RenderPart /* result of part rendering */ RenderResult *result; - int *rectp; /* polygon index table */ + int *rectp; /* polygon index table */ int *rectz; /* zbuffer */ long *rectdaps; /* delta acum buffer for pixel structs */ + int *rectbackp; /* polygon index table for backside sss */ + int *rectbackz; /* zbuffer for backside sss */ + long *rectall; /* buffer for all faces for sss */ rcti disprect; /* part coordinates within total picture */ int rectx, recty; /* the size */ @@ -169,6 +172,10 @@ struct Render struct GHash *orco_hash; + struct GHash *sss_hash; + ListBase *sss_points; + struct Material *sss_mat; + ListBase customdata_names; /* arena for allocating data for use during render, for @@ -262,7 +269,7 @@ typedef struct VlakRen { unsigned int lay; float n[3]; struct Material *mat; - char snproj, puno; + char noflag, puno; char flag, ec; RadFace *radface; Object *ob; @@ -393,7 +400,11 @@ typedef struct LampRen { /* vertex normals are tangent or view-corrected vector, for hair strands */ #define R_TANGENT 128 - +/* vlakren->noflag (char) */ +#define R_SNPROJ_X 1 +#define R_SNPROJ_Y 2 +#define R_SNPROJ_Z 4 +#define R_FLIPPED_NO 8 diff --git a/source/blender/render/intern/include/rendercore.h b/source/blender/render/intern/include/rendercore.h index 9f22480f0cb..651fd423e5d 100644 --- a/source/blender/render/intern/include/rendercore.h +++ b/source/blender/render/intern/include/rendercore.h @@ -87,6 +87,8 @@ void zbufshadeDA(void); /* Delta Accum Pixel Struct */ void zbufshade_tile(struct RenderPart *pa); void zbufshadeDA_tile(struct RenderPart *pa); +void zbufshade_sss_tile(struct RenderPart *pa); + /* -------- ray.c ------- */ extern void freeoctree(Render *re); diff --git a/source/blender/render/intern/include/sss.h b/source/blender/render/intern/include/sss.h new file mode 100644 index 00000000000..660fb544227 --- /dev/null +++ b/source/blender/render/intern/include/sss.h @@ -0,0 +1,65 @@ +/** + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2007 Blender Foundation. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef SSS_H +#define SSS_H + +/* Generic multiple scattering API */ + +struct ScatterSettings; +typedef struct ScatterSettings ScatterSettings; + +struct ScatterTree; +typedef struct ScatterTree ScatterTree; + +ScatterSettings *scatter_settings_new(float refl, float radius, float ior, + float reflfac, float frontweight, float backweight); +void scatter_settings_free(ScatterSettings *ss); + +ScatterTree *scatter_tree_new(ScatterSettings *ss[3], float scale, float error, + float (*co)[3], float (*color)[3], float *area, int totpoint); +void scatter_tree_build(ScatterTree *tree); +void scatter_tree_sample(ScatterTree *tree, float *co, float *color); +void scatter_tree_free(ScatterTree *tree); + +/* Internal renderer API */ + +struct Render; +struct Material; +struct VlakRen; + +void make_sss_tree(struct Render *re); +void sss_add_points(Render *re, float (*co)[3], float (*color)[3], float *area, int totpoint); +void free_sss(struct Render *re); + +int sample_sss(struct Render *re, struct Material *mat, float *co, float *col); +int has_sss_tree(struct Render *re, struct Material *mat); + +#endif /*SSS_H*/ + diff --git a/source/blender/render/intern/include/zbuf.h b/source/blender/render/intern/include/zbuf.h index c308ae25bce..ed3f93adfdd 100644 --- a/source/blender/render/intern/include/zbuf.h +++ b/source/blender/render/intern/include/zbuf.h @@ -51,6 +51,7 @@ void zbuffer_shadow(struct Render *re, struct LampRen *lar, int *rectz, int size void zbuffer_solid(struct RenderPart *pa, unsigned int layer, short layflag); unsigned short *zbuffer_transp_shade(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)); typedef struct APixstr { unsigned short mask[4]; /* jitter mask */ @@ -85,6 +86,9 @@ typedef struct ZSpan { int polygon_offset; /* offset in Z */ float shad_alpha; /* copy from material, used by irregular shadbuf */ int mask, apsmcounter; /* in use by apixbuf */ + + void *sss_handle; /* used by sss */ + void (*sss_func)(void *, int, int, int, int); void (*zbuffunc)(struct ZSpan *, int, float *, float *, float *, float *); void (*zbuflinefunc)(struct ZSpan *, int, float *, float *); |