diff options
author | Andre Susano Pinto <andresusanopinto@gmail.com> | 2009-09-15 19:15:43 +0400 |
---|---|---|
committer | Andre Susano Pinto <andresusanopinto@gmail.com> | 2009-09-15 19:15:43 +0400 |
commit | f7c686d0ae68842feddd4f37deadab12e1fa4991 (patch) | |
tree | 52773e6d6236aec9a3a80bf6c5c1ea5f7e943224 /source/blender/render/intern/include | |
parent | f8657be654f89c6a4826ef8dd3e2275dfe2d4a5a (diff) | |
parent | 0338b05a64184ce1a439a418ebc4e315185c1eec (diff) |
svn merge -r 22571:22800 https://svn.blender.org/svnroot/bf-blender/trunk/blender
svn merge -r 22800:23207 https://svn.blender.org/svnroot/bf-blender/trunk/blender
Merged volumetric with new raytrace code (it compiles and rendered volume-cube.blend withouth problems)
Part1:
source/blender
Diffstat (limited to 'source/blender/render/intern/include')
-rw-r--r-- | source/blender/render/intern/include/pointdensity.h | 44 | ||||
-rw-r--r-- | source/blender/render/intern/include/rayobject.h | 7 | ||||
-rw-r--r-- | source/blender/render/intern/include/render_types.h | 47 | ||||
-rw-r--r-- | source/blender/render/intern/include/rendercore.h | 1 | ||||
-rw-r--r-- | source/blender/render/intern/include/shading.h | 6 | ||||
-rw-r--r-- | source/blender/render/intern/include/texture.h | 1 | ||||
-rw-r--r-- | source/blender/render/intern/include/volume_precache.h | 33 | ||||
-rw-r--r-- | source/blender/render/intern/include/volumetric.h | 47 | ||||
-rw-r--r-- | source/blender/render/intern/include/voxeldata.h | 45 |
9 files changed, 223 insertions, 8 deletions
diff --git a/source/blender/render/intern/include/pointdensity.h b/source/blender/render/intern/include/pointdensity.h new file mode 100644 index 00000000000..93cdef3b14e --- /dev/null +++ b/source/blender/render/intern/include/pointdensity.h @@ -0,0 +1,44 @@ +/* + * + * ***** 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) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Matt Ebb + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef POINTDENSITY_H +#define POINTDENSITY_H + +/** + * Make point density kd-trees for all point density textures in the scene + */ + +struct Render; +struct TexResult; + +void make_pointdensities(struct Render *re); +void free_pointdensities(struct Render *re); +int pointdensitytex(struct Tex *tex, float *texvec, struct TexResult *texres); + +#endif /* POINTDENSITY_H */ + diff --git a/source/blender/render/intern/include/rayobject.h b/source/blender/render/intern/include/rayobject.h index 2a9b42d22fe..19608fba262 100644 --- a/source/blender/render/intern/include/rayobject.h +++ b/source/blender/render/intern/include/rayobject.h @@ -152,13 +152,6 @@ typedef struct RayObjectAPI } RayObjectAPI; - - -/* - * Extend min/max coords so that the rayobject is inside them - */ -void RE_rayobject_merge_bb(RayObject *ob, float *min, float *max); - /* * This function differs from RE_rayobject_raycast * RE_rayobject_intersect does NOT perform last-hit optimization diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index c412921eb31..67c69259213 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -205,6 +205,9 @@ struct Render ListBase customdata_names; struct Object *excludeob; + ListBase render_volumes_inside; + ListBase volumes; + ListBase volume_precache_parts; /* arena for allocating data for use during render, for * example dynamic TFaces to go in the VlakRen structure. @@ -302,7 +305,9 @@ typedef struct ObjectInstanceRen { float dupliorco[3], dupliuv[2]; float (*duplitexmat)[4]; - + + struct VolumePrecache *volume_precache; + float *vectors; int totvector; @@ -416,6 +421,46 @@ typedef struct StrandRen { float orco[3]; } StrandRen; +/* ------------------------------------------------------------------------- */ + +typedef struct VolumeOb +{ + struct VolumeOb *next, *prev; + struct Material *ma; + struct ObjectRen *obr; +} VolumeOb; + +typedef struct MatInside { + struct MatInside *next, *prev; + struct Material *ma; + struct ObjectInstanceRen *obi; +} MatInside; + +typedef struct VolPrecachePart +{ + struct VolPrecachePart *next, *prev; + struct RayObject *tree; + struct ShadeInput *shi; + struct ObjectInstanceRen *obi; + int num; + int minx, maxx; + int miny, maxy; + int minz, maxz; + int res[3]; + float bbmin[3]; + float voxel[3]; + int working, done; +} VolPrecachePart; + +typedef struct VolumePrecache +{ + int res[3]; + float *data_r; + float *data_g; + float *data_b; +} VolumePrecache; + +/* ------------------------------------------------------------------------- */ struct LampRen; struct MTex; diff --git a/source/blender/render/intern/include/rendercore.h b/source/blender/render/intern/include/rendercore.h index 4b28529a147..250fbc000cb 100644 --- a/source/blender/render/intern/include/rendercore.h +++ b/source/blender/render/intern/include/rendercore.h @@ -95,6 +95,7 @@ int get_sample_layers(struct RenderPart *pa, struct RenderLayer *rl, struct Rend extern void freeraytree(Render *re); extern void makeraytree(Render *re); +RayObject* makeraytree_object(Render *re, ObjectInstanceRen *obi); extern void ray_shadow(ShadeInput *, LampRen *, float *); extern void ray_trace(ShadeInput *, ShadeResult *); diff --git a/source/blender/render/intern/include/shading.h b/source/blender/render/intern/include/shading.h index d195f32d5ef..95bccd2be1e 100644 --- a/source/blender/render/intern/include/shading.h +++ b/source/blender/render/intern/include/shading.h @@ -33,6 +33,7 @@ struct VlakRen; struct StrandSegment; struct StrandPoint; struct ObjectInstanceRen obi; +struct Isect; /* shadeinput.c */ @@ -52,6 +53,7 @@ typedef struct ShadeSample { /* also the node shader callback */ void shade_material_loop(struct ShadeInput *shi, struct ShadeResult *shr); +void shade_volume_loop(struct ShadeInput *shi, struct ShadeResult *shr); void shade_input_set_triangle_i(struct ShadeInput *shi, struct ObjectInstanceRen *obi, struct VlakRen *vlr, short i1, short i2, short i3); void shade_input_set_triangle(struct ShadeInput *shi, volatile int obi, volatile int facenr, int normal_flip); @@ -87,7 +89,11 @@ void shade_color(struct ShadeInput *shi, ShadeResult *shr); void ambient_occlusion_to_diffuse(struct ShadeInput *shi, float *diff); void ambient_occlusion(struct ShadeInput *shi); +ListBase *get_lights(struct ShadeInput *shi); float lamp_get_visibility(struct LampRen *lar, float *co, float *lv, float *dist); void lamp_get_shadow(struct LampRen *lar, ShadeInput *shi, float inp, float *shadfac, int do_real); float fresnel_fac(float *view, float *vn, float fresnel, float fac); + +/* rayshade.c */ +extern void shade_ray(struct Isect *is, struct ShadeInput *shi, struct ShadeResult *shr); diff --git a/source/blender/render/intern/include/texture.h b/source/blender/render/intern/include/texture.h index c254b768292..78d6a912af1 100644 --- a/source/blender/render/intern/include/texture.h +++ b/source/blender/render/intern/include/texture.h @@ -56,6 +56,7 @@ void do_halo_tex(struct HaloRen *har, float xn, float yn, float *colf); void do_sky_tex(float *rco, float *lo, float *dxyview, float *hor, float *zen, float *blend, int skyflag, short thread); void do_material_tex(struct ShadeInput *shi); void do_lamp_tex(LampRen *la, float *lavec, struct ShadeInput *shi, float *colf, int effect); +void do_volume_tex(struct ShadeInput *shi, float *xyz, int mapto_flag, float *col, float *val); void init_render_textures(Render *re); void end_render_textures(void); diff --git a/source/blender/render/intern/include/volume_precache.h b/source/blender/render/intern/include/volume_precache.h new file mode 100644 index 00000000000..9d87a219c82 --- /dev/null +++ b/source/blender/render/intern/include/volume_precache.h @@ -0,0 +1,33 @@ +/** + * + * ***** 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) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Matt Ebb. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +void volume_precache(Render *re); +void free_volume_precache(Render *re); +int point_inside_volume_objectinstance(ObjectInstanceRen *obi, float *co); + +#define VOL_MS_TIMESTEP 0.1f
\ No newline at end of file diff --git a/source/blender/render/intern/include/volumetric.h b/source/blender/render/intern/include/volumetric.h new file mode 100644 index 00000000000..026b4840ea3 --- /dev/null +++ b/source/blender/render/intern/include/volumetric.h @@ -0,0 +1,47 @@ +/** + * + * ***** 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) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Matt Ebb. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +float vol_get_stepsize(struct ShadeInput *shi, int context); +float vol_get_density(struct ShadeInput *shi, float *co); +void vol_get_scattering(ShadeInput *shi, float *scatter_col, float *co, float stepsize, float density); + +void shade_volume_outside(ShadeInput *shi, ShadeResult *shr); +void shade_volume_inside(ShadeInput *shi, ShadeResult *shr); +void shade_volume_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct Isect *last_is); + +#define STEPSIZE_VIEW 0 +#define STEPSIZE_SHADE 1 + +#define VOL_IS_BACKFACE 1 +#define VOL_IS_SAMEMATERIAL 2 + +#define VOL_BOUNDS_DEPTH 0 +#define VOL_BOUNDS_SS 1 + +#define VOL_SHADE_OUTSIDE 0 +#define VOL_SHADE_INSIDE 1 diff --git a/source/blender/render/intern/include/voxeldata.h b/source/blender/render/intern/include/voxeldata.h new file mode 100644 index 00000000000..b291bdc096d --- /dev/null +++ b/source/blender/render/intern/include/voxeldata.h @@ -0,0 +1,45 @@ +/** + * + * ***** 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) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Raul Fernandez Hernandez (Farsthary), Matt Ebb. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef VOXELDATA_H +#define VOXELDATA_H + +struct Render; +struct TexResult; + +typedef struct VoxelDataHeader +{ + int resolX, resolY, resolZ; + int frames; +} VoxelDataHeader; + +void make_voxeldata(struct Render *re); +void free_voxeldata(struct Render *re); +int voxeldatatex(struct Tex *tex, float *texvec, struct TexResult *texres); + +#endif /* VOXELDATA_H */ |