diff options
Diffstat (limited to 'source/blender/render/intern/include')
25 files changed, 6 insertions, 2182 deletions
diff --git a/source/blender/render/intern/include/envmap.h b/source/blender/render/intern/include/envmap.h deleted file mode 100644 index 627e6c0e1e6..00000000000 --- a/source/blender/render/intern/include/envmap.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * envmap_ext.h - * - * - * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -/** \file blender/render/intern/include/envmap.h - * \ingroup render - */ - - -#ifndef __ENVMAP_H__ -#define __ENVMAP_H__ - -/** - * Make environment maps for all objects in the scene that have an - * environment map as texture. - * (initrender.c) - */ - -struct Render; -struct TexResult; -struct ImagePool; - -void make_envmaps(struct Render *re); -int envmaptex(struct Tex *tex, const float texvec[3], float dxt[3], float dyt[3], int osatex, struct TexResult *texres, struct ImagePool *pool, const bool skip_image_load); -void env_rotate_scene(struct Render *re, float mat[4][4], int do_rotate); - -#endif /* __ENVMAP_H__ */ - diff --git a/source/blender/render/intern/include/initrender.h b/source/blender/render/intern/include/initrender.h index 87e2d2519d5..e7ff3c7097c 100644 --- a/source/blender/render/intern/include/initrender.h +++ b/source/blender/render/intern/include/initrender.h @@ -33,16 +33,11 @@ #ifndef __INITRENDER_H__ #define __INITRENDER_H__ - /* Functions */ -void free_sample_tables(Render *re); -void make_sample_tables(Render *re); - -void RE_parts_init(Render *re, bool do_crop); +void RE_parts_init(Render *re); void RE_parts_free(Render *re); void RE_parts_clamp(Render *re); - #endif /* __INITRENDER_H__ */ diff --git a/source/blender/render/intern/include/occlusion.h b/source/blender/render/intern/include/occlusion.h deleted file mode 100644 index 4a70d691436..00000000000 --- a/source/blender/render/intern/include/occlusion.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * The Original Code is Copyright (C) 2008 Blender Foundation. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): Brecht Van Lommel. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -/** \file blender/render/intern/include/occlusion.h - * \ingroup render - */ - - -#ifndef __OCCLUSION_H__ -#define __OCCLUSION_H__ - -struct Render; -struct ShadeInput; -struct RenderPart; -struct ShadeSample; - -void make_occ_tree(struct Render *re); -void free_occ(struct Render *re); -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); - -#endif - diff --git a/source/blender/render/intern/include/pixelblending.h b/source/blender/render/intern/include/pixelblending.h deleted file mode 100644 index 17a872a0676..00000000000 --- a/source/blender/render/intern/include/pixelblending.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * Contributor(s): 2004-2006 Blender Foundation, full recode - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -/** \file blender/render/intern/include/pixelblending.h - * \ingroup render - */ - - -#ifndef __PIXELBLENDING_H__ -#define __PIXELBLENDING_H__ - - -/** - * add 1 pixel to into filtered three lines - * (float vecs to float vec) - */ -void add_filt_fmask(unsigned int mask, const float col[4], float *rowbuf, int row_w); -void add_filt_fmask_pixsize(unsigned int mask, float *in, float *rowbuf, int row_w, int pixsize); -void add_filt_fmask_coord(float filt[3][3], const float col[4], float *rowbuf, int row_stride, int x, int y, rcti *mask); -void mask_array(unsigned int mask, float filt[3][3]); - -/** - * Alpha-over blending for floats. - */ -void addAlphaOverFloat(float dest[4], const float source[4]); - -/** - * Alpha-under blending for floats. - */ -void addAlphaUnderFloat(float dest[4], const float source[4]); - - -/** - * Same for floats - */ -void addalphaAddfacFloat(float dest[4], const float source[4], char addfac); - -/** - * dest = dest + source - */ -void addalphaAddFloat(float dest[4], const float source[4]); - -#endif /* __PIXELBLENDING_H__ */ diff --git a/source/blender/render/intern/include/pixelshading.h b/source/blender/render/intern/include/pixelshading.h deleted file mode 100644 index 8f23455564f..00000000000 --- a/source/blender/render/intern/include/pixelshading.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * Contributor(s): 2004-2006, Blender Foundation, full recode - * - * ***** END GPL LICENSE BLOCK ***** - */ - -/** \file blender/render/intern/include/pixelshading.h - * \ingroup render - * - * These functions determine what actual color a pixel will have. - */ - -#ifndef __PIXELSHADING_H__ -#define __PIXELSHADING_H__ - - -/** - * Render the pixel at (x,y) for object ap. Apply the jitter mask. - * Output is given in float collector[4]. The type vector: - * t[0] - min. distance - * t[1] - face/halo index - * t[2] - jitter mask - * t[3] - type ZB_POLY or ZB_HALO - * t[4] - max. distance - * mask is pixel coverage in bits - * \return pointer to the object - */ -int shadeHaloFloat(HaloRen *har, - float *col, int zz, - float dist, float xn, - float yn, short flarec); - -/** - * Render the sky at pixel (x, y). - */ -void shadeSkyPixel(float collector[4], float fx, float fy, short thread); -void shadeSkyView(float col_r[3], const float rco[3], const float view[3], const float dxyview[2], short thread); -void shadeAtmPixel(struct SunSky *sunsky, float *collector, float fx, float fy, float distance); -void shadeSunView(float col_r[3], const float view[3]); -/* ------------------------------------------------------------------------- */ - -#endif - diff --git a/source/blender/render/intern/include/pointdensity.h b/source/blender/render/intern/include/pointdensity.h deleted file mode 100644 index 263fa44f9c4..00000000000 --- a/source/blender/render/intern/include/pointdensity.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 ***** - */ - -/** \file blender/render/intern/include/pointdensity.h - * \ingroup render - */ - - -#ifndef __POINTDENSITY_H__ -#define __POINTDENSITY_H__ - -/** - * Make point density kd-trees for all point density textures in the scene - */ - -struct Depsgraph; -struct PointDensity; -struct Render; -struct TexResult; - -void free_pointdensity(struct PointDensity *pd); -void cache_pointdensity(struct Depsgraph *depsgraph, struct Render *re, struct PointDensity *pd); -void make_pointdensities(struct Depsgraph *depsgraph, struct Render *re); -void free_pointdensities(struct Render *re); -int pointdensitytex(struct Tex *tex, const float texvec[3], struct TexResult *texres); - -#endif /* __POINTDENSITY_H__ */ - diff --git a/source/blender/render/intern/include/raycounter.h b/source/blender/render/intern/include/raycounter.h deleted file mode 100644 index 1694273df0e..00000000000 --- a/source/blender/render/intern/include/raycounter.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * The Original Code is Copyright (C) 2009 Blender Foundation. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): André Pinto. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -/** \file blender/render/intern/include/raycounter.h - * \ingroup render - */ - - -#ifndef __RAYCOUNTER_H__ -#define __RAYCOUNTER_H__ - -//#define RE_RAYCOUNTER /* enable counters per ray, useful for measuring raytrace structures performance */ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef RE_RAYCOUNTER - -/* ray counter functions */ - -typedef struct RayCounter { - struct { - unsigned long long test, hit; - } faces, bb, simd_bb, raycast, raytrace_hint, rayshadow_last_hit; -} RayCounter; - -#define RE_RC_INIT(isec, shi) (isec).raycounter = &((shi).shading.raycounter) -void RE_RC_INFO(RayCounter *rc); -void RE_RC_MERGE(RayCounter *rc, RayCounter *tmp); -#define RE_RC_COUNT(var) (var)++ - -extern RayCounter re_rc_counter[]; - -#else - -/* ray counter stubs */ - -#define RE_RC_INIT(isec,shi) -#define RE_RC_INFO(rc) -#define RE_RC_MERGE(dest,src) -#define RE_RC_COUNT(var) - -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/source/blender/render/intern/include/rayintersection.h b/source/blender/render/intern/include/rayintersection.h deleted file mode 100644 index 1935e4ef59c..00000000000 --- a/source/blender/render/intern/include/rayintersection.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * The Original Code is Copyright (C) 2007 Blender Foundation. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): André Pinto. - * - * ***** END GPL LICENSE BLOCK ***** - * RE_raytrace.h: ray tracing api, can be used independently from the renderer. - */ - -/** \file blender/render/intern/include/rayintersection.h - * \ingroup render - */ - - -#ifndef __RAYINTERSECTION_H__ -#define __RAYINTERSECTION_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "BLI_math_geom.h" - -struct RayObject; - -/* Ray Hints */ - -#define RE_RAY_LCTS_MAX_SIZE 256 -#define RT_USE_LAST_HIT /* last shadow hit is reused before raycasting on whole tree */ -//#define RT_USE_HINT /* last hit object is reused before raycasting on whole tree */ - -typedef struct LCTSHint { - int size; - struct RayObject *stack[RE_RAY_LCTS_MAX_SIZE]; -} LCTSHint; - -typedef struct RayHint { - union { LCTSHint lcts; } data; -} RayHint; - -/* Ray Intersection */ - -typedef struct Isect { - /* ray start, direction (normalized vector), and max distance. on hit, - * the distance is modified to be the distance to the hit point. */ - float start[3]; - float dir[3]; - float dist; - - /* for envmap and incremental view update renders */ - float origstart[3]; - float origdir[3]; - - /* precomputed values to accelerate bounding box intersection */ - int bv_index[6]; - float idot_axis[3]; - - /* intersection options */ - int mode; /* RE_RAY_SHADOW, RE_RAY_MIRROR, RE_RAY_SHADOW_TRA */ - int lay; /* -1 default, set for layer lamps */ - int skip; /* skip flags */ - int check; /* check flags */ - void *userdata; /* used by bake check */ - - /* hit information */ - float u, v; - int isect; /* which half of quad */ - - struct { - void *ob; - void *face; - } hit, orig; - - /* last hit optimization */ - struct RayObject *last_hit; - - /* hints */ -#ifdef RT_USE_HINT - RayTraceHint *hint, *hit_hint; -#endif - RayHint *hint; - - /* ray counter */ -#ifdef RE_RAYCOUNTER - RayCounter *raycounter; -#endif - - /* Precalculated coefficients for watertight intersection check. */ - struct IsectRayPrecalc isect_precalc; -} Isect; - -/* ray types */ -#define RE_RAY_SHADOW 0 -#define RE_RAY_MIRROR 1 -#define RE_RAY_SHADOW_TRA 2 - -/* skip options */ -#define RE_SKIP_CULLFACE (1 << 0) -/* if using this flag then *face should be a pointer to a VlakRen */ -#define RE_SKIP_VLR_NEIGHBOUR (1 << 1) - -/* check options */ -#define RE_CHECK_VLR_NONE 0 -#define RE_CHECK_VLR_RENDER 1 -#define RE_CHECK_VLR_NON_SOLID_MATERIAL 2 -#define RE_CHECK_VLR_BAKE 3 - -/* arbitrary, but can't use e.g. FLT_MAX because of precision issues */ -#define RE_RAYTRACE_MAXDIST 1e15f -#define RE_RAYTRACE_EPSILON 0.0f - -#ifdef __cplusplus -} -#endif - -#endif /* __RAYINTERSECTION_H__ */ - diff --git a/source/blender/render/intern/include/rayobject.h b/source/blender/render/intern/include/rayobject.h deleted file mode 100644 index 63135d01c23..00000000000 --- a/source/blender/render/intern/include/rayobject.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * The Original Code is Copyright (C) 2009 Blender Foundation. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): André Pinto. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -/** \file blender/render/intern/include/rayobject.h - * \ingroup render - */ - - -#ifndef __RAYOBJECT_H__ -#define __RAYOBJECT_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -struct Isect; -struct ObjectInstanceRen; -struct RayHint; -struct VlakRen; - -/* RayObject - * Can be a face/triangle, bvh tree, object instance, etc. This is the - * public API used by the renderer, see rayobject_internal.h for the - * internal implementation details. - * */ -typedef struct RayObject RayObject; - -/* Intersection, see rayintersection.h */ - -int RE_rayobject_raycast(RayObject *r, struct Isect *i); - -/* Acceleration Structures */ - -RayObject *RE_rayobject_octree_create(int ocres, int size); -RayObject *RE_rayobject_instance_create(RayObject *target, float transform[4][4], void *ob, void *target_ob); -RayObject *RE_rayobject_empty_create(void); - -RayObject *RE_rayobject_vbvh_create(int size); /* raytrace/rayobject_vbvh.c */ -RayObject *RE_rayobject_svbvh_create(int size); /* raytrace/rayobject_svbvh.c */ -RayObject *RE_rayobject_qbvh_create(int size); /* raytrace/rayobject_qbvh.c */ - -/* Building */ - -void RE_rayobject_add(RayObject *r, RayObject *); -void RE_rayobject_done(RayObject *r); -void RE_rayobject_free(RayObject *r); - -void RE_rayobject_set_control(RayObject *r, void *data, int (*test_break)(void *data)); - -/* RayObject representing faces, all data is locally available instead - * of referring to some external data structure, for possibly faster - * intersection tests. */ - -typedef struct RayFace { - float v1[4], v2[4], v3[4], v4[3]; - int quad; - void *ob; - void *face; -} RayFace; - -#define RE_rayface_isQuad(a) ((a)->quad) - -RayObject *RE_rayface_from_vlak(RayFace *face, struct ObjectInstanceRen *obi, struct VlakRen *vlr); - -RayObject *RE_rayface_from_coords(RayFace *rayface, void *ob, void *face, float *v1, float *v2, float *v3, float *v4); - -/* RayObject representing faces directly from a given VlakRen structure. Thus - * allowing to save memory, but making code triangle intersection dependent on - * render structures. */ - -typedef struct VlakPrimitive { - struct ObjectInstanceRen *ob; - struct VlakRen *face; -} VlakPrimitive; - -RayObject *RE_vlakprimitive_from_vlak(VlakPrimitive *face, struct ObjectInstanceRen *obi, struct VlakRen *vlr); - -/* Bounding Box */ - -/* extend min/max coords so that the rayobject is inside them */ -void RE_rayobject_merge_bb(RayObject *ob, float *min, float *max); - -/* initializes an hint for optimizing raycast where it is know that a ray will pass by the given BB often the origin point */ -void RE_rayobject_hint_bb(RayObject *r, struct RayHint *hint, float min[3], float max[3]); - -/* initializes an hint for optimizing raycast where it is know that a ray will be contained inside the given cone*/ -/* void RE_rayobject_hint_cone(RayObject *r, struct RayHint *hint, float *); */ - -/* Internals */ - -#include "../raytrace/rayobject_internal.h" - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/source/blender/render/intern/include/render_result.h b/source/blender/render/intern/include/render_result.h index 03292579d90..9a1b1b5abe8 100644 --- a/source/blender/render/intern/include/render_result.h +++ b/source/blender/render/intern/include/render_result.h @@ -55,8 +55,6 @@ struct ColorManagedViewSettings; struct RenderResult *render_result_new(struct Render *re, struct rcti *partrct, int crop, int savebuffers, const char *layername, const char *viewname); -struct RenderResult *render_result_new_full_sample(struct Render *re, - struct ListBase *lb, struct rcti *partrct, int crop, int savebuffers, const char *viewname); struct RenderResult *render_result_new_from_exr(void *exrhandle, const char *colorspace, bool predivide, int rectx, int recty); diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index 97224d3aec0..8308b5e76e4 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -35,58 +35,19 @@ /* exposed internal in render module only! */ /* ------------------------------------------------------------------------- */ -#include "DNA_color_types.h" -#include "DNA_customdata_types.h" #include "DNA_scene_types.h" -#include "DNA_world_types.h" #include "DNA_object_types.h" -#include "DNA_vec_types.h" #include "BLI_threads.h" #include "BKE_main.h" #include "RE_pipeline.h" -#include "RE_shader_ext.h" /* TexResult, ShadeResult, ShadeInput */ -#include "sunsky.h" -#include "BLI_sys_types.h" // for intptr_t support - -struct Depsgraph; struct Object; -struct MemArena; -struct VertTableNode; -struct VlakTableNode; -struct GHash; -struct ObjectInstanceRen; -struct RayObject; -struct RayFace; struct RenderEngine; struct ReportList; struct Main; -struct ImagePool; - -#define TABLEINITSIZE 1024 - -typedef struct SampleTables { - float centLut[16]; - float *fmask1[9], *fmask2[9]; - char cmask[256], *centmask; - -} SampleTables; - -typedef struct QMCSampler { - struct QMCSampler *next, *prev; - int type; - int tot; - int used; - double *samp2d; - double offs[BLENDER_MAX_THREADS][2]; -} QMCSampler; - -// #define SAMP_TYPE_JITTERED 0 // UNUSED -#define SAMP_TYPE_HALTON 1 -#define SAMP_TYPE_HAMMERSLEY 2 /* this is handed over to threaded hiding/passes/shading engine */ typedef struct RenderPart { @@ -95,24 +56,10 @@ typedef struct RenderPart { RenderResult *result; /* result of part rendering */ ListBase fullresult; /* optional full sample buffers */ - int *recto; /* object table for objects */ - int *rectp; /* polygon index table */ - int *rectz; /* zbuffer */ - int *rectmask; /* negative zmask */ - intptr_t *rectdaps; /* delta acum buffer for pixel structs */ - int *rectbacko; /* object table for backside sss */ - int *rectbackp; /* polygon index table for backside sss */ - int *rectbackz; /* zbuffer for backside sss */ - intptr_t *rectall; /* buffer for all faces for sss */ - rcti disprect; /* part coordinates within total picture */ int rectx, recty; /* the size */ int nr; /* nr is partnr */ - short crop, status; /* crop is amount of pixels we crop, for filter */ - short sample; /* sample can be used by zbuffers */ - short thread; /* thread id */ - - char *clipflag; /* clipflags for part zbuffering */ + short status; } RenderPart; enum { @@ -129,10 +76,7 @@ struct Render { int slot; /* state settings */ - short flag, osa, ok, result_ok; - - /* due to performance issues, getting initialized from color management settings once on Render initialization */ - bool scene_color_manage; + short flag, ok, result_ok; /* result of rendering */ RenderResult *result; @@ -150,8 +94,6 @@ struct Render { * without border & crop. convert to long before multiplying together to avoid overflow. */ rcti disprect; /* part within winx winy */ rctf viewplane; /* mapped on winx winy */ - float viewdx, viewdy; /* size of 1 pixel */ - float clipcrop; /* 2 pixel boundary to prevent clip when filter used */ /* final picture width and height (within disprect) */ int rectx, recty; @@ -160,14 +102,7 @@ struct Render { * partx*xparts can be larger than rectx, in that case last part is smaller */ int partx, party; - /* values for viewing */ - float ycor; /* (scene->xasp / scene->yasp), multiplied with 'winy' */ - - float panophi, panosi, panoco, panodxp, panodxv; - - /* Matrices */ - float grvec[3]; /* for world */ - float imat[3][3]; /* copy of viewinv */ + /* Camera transform, only used by Freestyle. */ float viewmat[4][4], viewinv[4][4]; float viewmat_orig[4][4]; /* for incremental render */ float winmat[4][4]; @@ -176,23 +111,12 @@ struct Render { float clipsta; float clipend; - /* samples */ - SampleTables *samples; - float jit[32][2]; - float mblur_jit[32][2]; - ListBase *qmcsamplers; - int num_qmc_samplers; - - /* shadow counter, detect shadow-reuse for shaders */ - int shadowsamplenr[BLENDER_MAX_THREADS]; - /* main, scene, and its full copy of renderdata and world */ struct Main *main; Scene *scene; RenderData r; ListBase view_layers; int active_view_layer; - World wrld; struct Object *camera_override; unsigned int lay, layer_override; @@ -202,56 +126,11 @@ struct Render { /* render engine */ struct RenderEngine *engine; - /* octree tables and variables for raytrace */ - struct RayObject *raytree; - struct RayFace *rayfaces; - struct VlakPrimitive *rayprimitives; - float maxdist; /* needed for keeping an incorrect behavior of SUN and HEMI lights (avoid breaking old scenes) */ - - /* occlusion tree */ - void *occlusiontree; - ListBase strandsurface; - - /* use this instead of R.r.cfra */ - float mblur_offs, field_offs; - - /* render database */ - int totvlak, totvert, tothalo, totstrand, totlamp; - struct HaloRen **sortedhalos; - - ListBase lights; /* GroupObject pointers */ - ListBase lampren; /* storage, for free */ - - ListBase objecttable; - - struct ObjectInstanceRen *objectinstance; - ListBase instancetable; - int totinstance; - - struct Image *bakebuf; - - struct GHash *orco_hash; - - struct GHash *sss_hash; - ListBase *sss_points; - struct Material *sss_mat; - - ListBase customdata_names; - - struct Object *excludeob; - ListBase render_volumes_inside; - ListBase volumes; - #ifdef WITH_FREESTYLE struct Main *freestyle_bmain; ListBase freestyle_renders; #endif - /* arena for allocating data for use during render, for - * example dynamic TFaces to go in the VlakRen structure. - */ - struct MemArena *memArena; - /* callbacks */ void (*display_init)(void *handle, RenderResult *rr); void *dih; @@ -276,414 +155,14 @@ struct Render { struct ReportList *reports; - struct ImagePool *pool; - void **movie_ctx_arr; char viewname[MAX_NAME]; }; -/* ------------------------------------------------------------------------- */ - -struct ISBData; - -typedef struct DeepSample { - int z; - float v; -} DeepSample; - -typedef struct ShadSampleBuf { - struct ShadSampleBuf *next, *prev; - intptr_t *zbuf; - char *cbuf; - DeepSample **deepbuf; - int *totbuf; -} ShadSampleBuf; - -typedef struct ShadBuf { - /* regular shadowbuffer */ - short samp, shadhalostep, totbuf; - float persmat[4][4]; - float viewmat[4][4]; - float winmat[4][4]; - float *jit, *weight; - float d, clipend, pixsize, soft, compressthresh; - int co[3]; - int size, bias; - ListBase buffers; - - /* irregular shadowbufer, result stored per thread */ - struct ISBData *isb_result[BLENDER_MAX_THREADS]; -} ShadBuf; - -/* ------------------------------------------------------------------------- */ - -typedef struct ObjectRen { - struct ObjectRen *next, *prev; - struct Object *ob, *par; - struct Scene *sce; - int index, psysindex, flag, lay; - - float boundbox[2][3]; - - int totvert, totvlak, totstrand, tothalo; - int vertnodeslen, vlaknodeslen, strandnodeslen, blohalen; - struct VertTableNode *vertnodes; - struct VlakTableNode *vlaknodes; - struct StrandTableNode *strandnodes; - struct HaloRen **bloha; - struct StrandBuffer *strandbuf; - - char (*mtface)[MAX_CUSTOMDATA_LAYER_NAME]; - char (*mcol)[MAX_CUSTOMDATA_LAYER_NAME]; - int actmtface, actmcol, bakemtface; - - short tangent_mask; /* which tangent layer should be calculated */ - - float obmat[4][4]; /* only used in convertblender.c, for instancing */ - - /* used on makeraytree */ - struct RayObject *raytree; - struct RayFace *rayfaces; - struct VlakPrimitive *rayprimitives; - struct ObjectInstanceRen *rayobi; - -} ObjectRen; - -typedef struct ObjectInstanceRen { - struct ObjectInstanceRen *next, *prev; - - ObjectRen *obr; - Object *ob, *par; - int index, psysindex, lay; - - float mat[4][4], imat[4][4]; - float nmat[3][3]; /* nmat is inverse mat tranposed */ - - float obmat[4][4], obinvmat[4][4]; - float localtoviewmat[4][4], localtoviewinvmat[4][4]; - - short flag; - - float dupliorco[3], dupliuv[2]; - float (*duplitexmat)[4]; - - struct VolumePrecache *volume_precache; - - float *vectors; /* (RE_WINSPEED_ELEMS * VertRen.index) */ - int totvector; - - /* used on makeraytree */ - struct RayObject *raytree; - int transform_primitives; - - /* Particle info */ - float part_index; - float part_age; - float part_lifetime; - float part_size; - float part_co[3]; - float part_vel[3]; - float part_avel[3]; - - unsigned int random_id; -} ObjectInstanceRen; - -/* ------------------------------------------------------------------------- */ - -typedef struct VertRen { - float co[3]; - float n[3]; - float *orco; - unsigned int flag; /* in use for clipping zbuffer parts, temp setting stuff in convertblender.c - * only an 'int' because of alignment, could be a char too */ - float accum; /* accum for radio weighting, and for strand texco static particles */ - int index; /* index allows extending vertren with any property */ -} VertRen; - -/* ------------------------------------------------------------------------- */ - -struct halosort { - struct HaloRen *har; - int z; -}; - -/* ------------------------------------------------------------------------- */ -struct Material; -struct ImagePool; - -typedef struct RadFace { - float unshot[3], totrad[3]; - float norm[3], cent[3], area; - int flag; -} RadFace; - -typedef struct VlakRen { - struct VertRen *v1, *v2, *v3, *v4; /* keep in order for ** addressing */ - float n[3]; - struct Material *mat; - char puno; - char flag, ec; -#ifdef WITH_FREESTYLE - char freestyle_edge_mark; - char freestyle_face_mark; -#endif - int index; -} VlakRen; - -typedef struct HaloRen { - short miny, maxy; - float alfa, xs, ys, rad, radsq, sin, cos, co[3], no[3]; - float hard, b, g, r; - int zs, zd; - int zBufDist; /* depth in the z-buffer coordinate system */ - char starpoints, type, add, tex; - char linec, ringc, seed; - short flarec; /* used to be a char. why ?*/ - float hasize; - int pixels; - unsigned int lay; - struct Material *mat; - struct ImagePool *pool; - bool skip_load_image, texnode_preview; -} HaloRen; - -/* ------------------------------------------------------------------------- */ - -typedef struct StrandVert { - float co[3]; - float strandco; -} StrandVert; - -typedef struct StrandSurface { - struct StrandSurface *next, *prev; - ObjectRen obr; - int (*face)[4]; - float (*co)[3]; - /* for occlusion caching */ - float (*ao)[3]; - float (*env)[3]; - float (*indirect)[3]; - /* for speedvectors */ - float (*prevco)[3], (*nextco)[3]; - int totvert, totface; -} StrandSurface; - -typedef struct StrandBound { - int start, end; - float boundbox[2][3]; -} StrandBound; - -typedef struct StrandBuffer { - struct StrandBuffer *next, *prev; - struct StrandVert *vert; - struct StrandBound *bound; - int totvert, totbound; - - struct ObjectRen *obr; - struct Material *ma; - struct StrandSurface *surface; - unsigned int lay; - int overrideuv; - int flag, maxdepth; - float adaptcos, minwidth, widthfade; - - float maxwidth; /* for cliptest of strands in blender unit */ - - float winmat[4][4]; - int winx, winy; -} StrandBuffer; - -typedef struct StrandRen { - StrandVert *vert; - StrandBuffer *buffer; - int totvert, flag; - int clip, index; - 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; - float viewmat[4][4]; - int num; - int minx, maxx; - int miny, maxy; - int minz, maxz; - int res[3]; - float bbmin[3]; - float voxel[3]; - struct Render *re; -} VolPrecachePart; - -typedef struct VolumePrecache { - int res[3]; - float *bbmin, *bbmax; - float *data_r; - float *data_g; - float *data_b; -} VolumePrecache; - -/* ------------------------------------------------------------------------- */ - -struct LampRen; -struct MTex; - -/** - * For each lamp in a scene, a LampRen is created. It determines the - * properties of a lightsource. - */ - -typedef struct LampShadowSubSample { - int samplenr; - float shadfac[4]; /* rgba shadow */ -} LampShadowSubSample; - -typedef struct LampShadowSample { - LampShadowSubSample s[16]; /* MAX OSA */ -} LampShadowSample; - -typedef struct LampRen { - struct LampRen *next, *prev; - - float xs, ys, dist; - float co[3]; - short type; - int mode; - float r, g, b, k; - float shdwr, shdwg, shdwb; - float energy, haint; - int lay; - float spotsi, spotbl; - float vec[3]; - float xsp, ysp, distkw, inpr; - float halokw, halo; - - short falloff_type; - float ld1, ld2; - float coeff_const, coeff_lin, coeff_quad; - struct CurveMapping *curfalloff; - - /* copied from Lamp, to decouple more rendering stuff */ - /** Size of the shadowbuffer */ - short bufsize; - /** Number of samples for the shadows */ - short samp; - /** Softness factor for shadow */ - float soft; - /** amount of subsample buffers and type of filter for sampling */ - short buffers, filtertype; - /** shadow buffer type (regular, irregular) */ - short buftype; - /** autoclip */ - short bufflag; - /** shadow plus halo: detail level */ - short shadhalostep; - /** Near clip of the lamp */ - float clipsta; - /** Far clip of the lamp */ - float clipend; - /** A small depth offset to prevent self-shadowing. */ - float bias; - /* Compression threshold for deep shadow maps */ - float compressthresh; - - short ray_samp, ray_sampy, ray_sampz, ray_samp_method, ray_samp_type, area_shape, ray_totsamp; - short xold[BLENDER_MAX_THREADS], yold[BLENDER_MAX_THREADS]; /* last jitter table for area lights */ - float area_size, area_sizey, area_sizez; - float adapt_thresh; - - /* sun/sky */ - struct SunSky *sunsky; - - struct ShadBuf *shb; - float *jitter; - - float imat[3][3]; - float spottexfac; - float sh_invcampos[3], sh_zfac; /* sh_= spothalo */ - - float lampmat[4][4]; /* worls space lamp matrix, used for scene rotation */ - - float mat[3][3]; /* 3x3 part from lampmat x viewmat */ - float area[8][3], areasize; - - /* passes & node shader support: all shadow info for a pixel */ - LampShadowSample *shadsamp; - - /* ray optim */ - struct RayObject *last_hit[BLENDER_MAX_THREADS]; - - struct MTex *mtex[MAX_MTEX]; - - /* threading */ - int thread_assigned; - int thread_ready; -} LampRen; - /* **************** defines ********************* */ -/* R.r.mode flag is same as for renderdata */ - /* R.flag */ -#define R_ZTRA 1 -#define R_HALO 2 -#define R_SEC_FIELD 4 -#define R_LAMPHALO 8 -#define R_NEED_TANGENT 16 -#define R_BAKE_TRACE 32 -#define R_BAKING 64 -#define R_ANIMATION 128 -#define R_NEED_VCOL 256 - -/* vlakren->flag (vlak = face in dutch) char!!! */ -#define R_SMOOTH 1 -#define R_HIDDEN 2 -/* strand flag, means special handling */ -#define R_STRAND 4 -#define R_FULL_OSA 8 -#define R_FACE_SPLIT 16 -/* Tells render to divide face other way. */ -#define R_DIVIDE_24 32 -/* vertex normals are tangent or view-corrected vector, for hair strands */ -#define R_TANGENT 64 -#define R_TRACEBLE 128 - -/* vlakren->freestyle_edge_mark */ -#ifdef WITH_FREESTYLE -# define R_EDGE_V1V2 1 -# define R_EDGE_V2V3 2 -# define R_EDGE_V3V4 4 -# define R_EDGE_V3V1 4 -# define R_EDGE_V4V1 8 -#endif - -/* strandbuffer->flag */ -#define R_STRAND_BSPLINE 1 -#define R_STRAND_B_UNITS 2 - -/* objectren->flag */ -#define R_INSTANCEABLE 1 - -/* objectinstance->flag */ -#define R_DUPLI_TRANSFORMED 1 -#define R_ENV_TRANSFORMED 2 -#define R_TRANSFORMED (1|2) +#define R_ANIMATION 1 #endif /* __RENDER_TYPES_H__ */ diff --git a/source/blender/render/intern/include/rendercore.h b/source/blender/render/intern/include/rendercore.h deleted file mode 100644 index c01db7db53e..00000000000 --- a/source/blender/render/intern/include/rendercore.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#ifndef __RENDERCORE_H__ -#define __RENDERCORE_H__ - -/** \file blender/render/intern/include/rendercore.h - * \ingroup render - */ - -#include "render_types.h" - -#include "RE_engine.h" - -#include "DNA_node_types.h" - -#include "NOD_composite.h" - -struct ShadeInput; -struct ShadeResult; -struct World; -struct RenderPart; -struct RenderLayer; -struct RayObject; - -/* ------------------------------------------------------------------------- */ - -typedef struct PixStr { - struct PixStr *next; - int obi, facenr, z, maskz; - unsigned short mask; - short shadfac; -} PixStr; - -typedef struct PixStrMain { - struct PixStrMain *next, *prev; - struct PixStr *ps; - int counter; -} PixStrMain; - -/* ------------------------------------------------------------------------- */ - - -void calc_view_vector(float view[3], float x, float y); -float mistfactor(float zcor, const float co[3]); /* dist and height, return alpha */ - -void renderspothalo(struct ShadeInput *shi, float col[4], float alpha); -void add_halo_flare(Render *re); - -void calc_renderco_zbuf(float co[3], const float view[3], int z); -void calc_renderco_ortho(float co[3], float x, float y, int z); - -int count_mask(unsigned short mask); - -void zbufshade_tile(struct RenderPart *pa); -void zbufshadeDA_tile(struct RenderPart *pa); - -void zbufshade_sss_tile(struct RenderPart *pa); - -int get_sample_layers(struct RenderPart *pa, struct RenderLayer *rl, struct RenderLayer **rlpp); - -void render_internal_update_passes(struct RenderEngine *engine, struct Scene *scene, struct ViewLayer *view_layer); - - -/* -------- ray.c ------- */ - -struct RayObject *RE_rayobject_create(int type, int size, int octree_resolution); - -extern void freeraytree(Render *re); -extern void makeraytree(Render *re); -struct RayObject* makeraytree_object(Render *re, ObjectInstanceRen *obi); - -extern void ray_shadow(ShadeInput *shi, LampRen *lar, float shadfac[4]); -extern void ray_trace(ShadeInput *shi, ShadeResult *); -extern void ray_ao(ShadeInput *shi, float ao[3], float env[3]); -extern void init_jitter_plane(LampRen *lar); -extern void init_ao_sphere(Render *re, struct World *wrld); -extern void init_render_qmcsampler(Render *re); -extern void free_render_qmcsampler(Render *re); - -#endif /* __RENDERCORE_H__ */ diff --git a/source/blender/render/intern/include/renderdatabase.h b/source/blender/render/intern/include/renderdatabase.h deleted file mode 100644 index 6b2deea57d8..00000000000 --- a/source/blender/render/intern/include/renderdatabase.h +++ /dev/null @@ -1,175 +0,0 @@ -/* - * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * The Original Code is Copyright (C) 2006 Blender Foundation. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -/** \file blender/render/intern/include/renderdatabase.h - * \ingroup render - */ - - -#ifndef __RENDERDATABASE_H__ -#define __RENDERDATABASE_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -struct Object; -struct VlakRen; -struct VertRen; -struct Depsgraph; -struct HaloRen; -struct Main; -struct Material; -struct Render; -struct MCol; -struct MTFace; -struct CustomData; -struct StrandBuffer; -struct StrandRen; -struct ObjectInstanceRen; -struct RadFace; -struct Isect; - -#define RE_QUAD_MASK 0x7FFFFFF -#define RE_QUAD_OFFS 0x8000000 - -/* render allocates totvert/256 of these nodes, for lookup and quick alloc */ -typedef struct VertTableNode { - struct VertRen *vert; - float *rad; - float *strand; - float *tangent; - float *stress; - float *winspeed; - /* Index of vertex in source mesh (before modifiers). */ - int *origindex; -} VertTableNode; - -typedef struct VlakTableNode { - struct VlakRen *vlak; - struct MTFace *mtface; - struct MCol *mcol; - /* Index of mpoly in source mesh (before tessellation). */ - int *origindex; - int totmtface, totmcol; - float *surfnor; - float *tangent_arrays[MAX_MTFACE]; - struct RadFace **radface; -} VlakTableNode; - -typedef struct StrandTableNode { - struct StrandRen *strand; - float *winspeed; - float *surfnor; - float *simplify; - int *face; - struct MCol *mcol; - float *uv; - int totuv, totmcol; -} StrandTableNode; - -/* renderdatabase.c */ -void free_renderdata_tables(struct Render *re); -void free_renderdata_vertnodes(struct VertTableNode *vertnodes); -void free_renderdata_vlaknodes(struct VlakTableNode *vlaknodes); - -void project_renderdata(struct Render *re, void (*projectfunc)(const float *, float mat[4][4], float *), bool do_pano, float xoffs, bool do_buckets); -int clip_render_object(float boundbox[2][3], float bounds[4], float mat[4][4]); - -/* functions are not exported... so wrong names */ - -struct VlakRen *RE_findOrAddVlak(struct ObjectRen *obr, int nr); -struct VertRen *RE_findOrAddVert(struct ObjectRen *obr, int nr); -struct StrandRen *RE_findOrAddStrand(struct ObjectRen *obr, int nr); -struct HaloRen *RE_findOrAddHalo(struct ObjectRen *obr, int nr); -struct HaloRen *RE_inithalo(struct Render *re, struct ObjectRen *obr, struct Material *ma, - const float vec[3], const float vec1[3], - const float *orco, float hasize, float vectsize, int seed); -struct HaloRen *RE_inithalo_particle(struct Render *re, struct ObjectRen *obr, struct DerivedMesh *dm, struct Material *ma, - const float vec[3], const float vec1[3], - const float *orco, const float *uvco, float hasize, float vectsize, int seed, - const float pa_co[3]); -struct StrandBuffer *RE_addStrandBuffer(struct ObjectRen *obr, int totvert); - -struct ObjectRen *RE_addRenderObject(struct Render *re, struct Object *ob, struct Object *par, int index, int psysindex, int lay); -struct ObjectInstanceRen *RE_addRenderInstance( - struct Render *re, struct ObjectRen *obr, struct Object *ob, struct Object *par, - int index, int psysindex, float mat[4][4], int lay, const struct DupliObject *dob); -void RE_makeRenderInstances(struct Render *re); -void RE_updateRenderInstance(Render *re, ObjectInstanceRen *obi, int flag); - -void RE_instance_rotate_ray_start(struct ObjectInstanceRen *obi, struct Isect *is); -void RE_instance_rotate_ray_dir(struct ObjectInstanceRen *obi, struct Isect *is); -void RE_instance_rotate_ray(struct ObjectInstanceRen *obi, struct Isect *is); -void RE_instance_rotate_ray_restore(struct ObjectInstanceRen *obi, struct Isect *is); - -float *RE_vertren_get_stress(struct ObjectRen *obr, struct VertRen *ver, int verify); -float *RE_vertren_get_rad(struct ObjectRen *obr, struct VertRen *ver, int verify); -float *RE_vertren_get_strand(struct ObjectRen *obr, struct VertRen *ver, int verify); -float *RE_vertren_get_tangent(struct ObjectRen *obr, struct VertRen *ver, int verify); -float *RE_vertren_get_winspeed(struct ObjectInstanceRen *obi, struct VertRen *ver, int verify); -int *RE_vertren_get_origindex(struct ObjectRen *obr, VertRen *ver, int verify); - -struct MTFace *RE_vlakren_get_tface(struct ObjectRen *obr, VlakRen *ren, int n, char **name, int verify); -struct MCol *RE_vlakren_get_mcol(struct ObjectRen *obr, VlakRen *ren, int n, char **name, int verify); -int *RE_vlakren_get_origindex(struct ObjectRen *obr, VlakRen *vlak, int verify); -float *RE_vlakren_get_surfnor(struct ObjectRen *obr, VlakRen *ren, int verify); -float *RE_vlakren_get_nmap_tangent(ObjectRen *obr, VlakRen *vlak, int index, bool verify); -RadFace **RE_vlakren_get_radface(struct ObjectRen *obr, VlakRen *ren, int verify); -void RE_vlakren_get_normal(struct Render *re, struct ObjectInstanceRen *obi, struct VlakRen *vlr, float *nor); - -float *RE_strandren_get_surfnor(struct ObjectRen *obr, struct StrandRen *strand, int verify); -float *RE_strandren_get_uv(struct ObjectRen *obr, struct StrandRen *strand, int n, char **name, int verify); -struct MCol *RE_strandren_get_mcol(struct ObjectRen *obr, struct StrandRen *strand, int n, char **name, int verify); -float *RE_strandren_get_simplify(struct ObjectRen *obr, struct StrandRen *strand, int verify); -int *RE_strandren_get_face(struct ObjectRen *obr, struct StrandRen *strand, int verify); -float *RE_strandren_get_winspeed(struct ObjectInstanceRen *obi, struct StrandRen *strand, int verify); - -struct VertRen *RE_vertren_copy(struct ObjectRen *obr, struct VertRen *ver); -struct VlakRen *RE_vlakren_copy(struct ObjectRen *obr, struct VlakRen *vlr); - -void RE_set_customdata_names(struct ObjectRen *obr, struct CustomData *data); - -void area_lamp_vectors(struct LampRen *lar); - - -/* haloren->type: flags */ -#define HA_ONLYSKY 1 -#define HA_VECT 2 -#define HA_XALPHA 4 -#define HA_FLARECIRC 8 - -/* convertblender.c */ -void init_render_world(Render *re); -void RE_Database_FromScene_Vectors(struct Depsgraph *depsgraph, Render *re, struct Main *bmain, struct Scene *sce, unsigned int lay); - -#ifdef __cplusplus -} -#endif - -#endif /* __RENDERDATABASE_H__ */ - diff --git a/source/blender/render/intern/include/renderpipeline.h b/source/blender/render/intern/include/renderpipeline.h index 8c23eb0d4cb..68fbc01b914 100644 --- a/source/blender/render/intern/include/renderpipeline.h +++ b/source/blender/render/intern/include/renderpipeline.h @@ -38,13 +38,10 @@ struct Render; struct RenderData; struct RenderLayer; struct RenderResult; -struct ViewRender; struct RenderLayer *render_get_active_layer(struct Render *re, struct RenderResult *rr); -float panorama_pixel_rot(struct Render *re); void render_update_anim_renderdata(struct Render *re, struct RenderData *rd, struct ListBase *render_layers); void render_copy_renderdata(struct RenderData *to, struct RenderData *from); -void render_copy_viewrender(struct ViewRender *to, struct ViewRender *from); #endif /* __RENDERPIPELINE_H__ */ diff --git a/source/blender/render/intern/include/shadbuf.h b/source/blender/render/intern/include/shadbuf.h deleted file mode 100644 index ddf5de8d974..00000000000 --- a/source/blender/render/intern/include/shadbuf.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#ifndef __SHADBUF_H__ -#define __SHADBUF_H__ - -/** \file blender/render/intern/include/shadbuf.h - * \ingroup render - */ - -#include "render_types.h" - - -/** - * Calculates shadowbuffers for a vector of shadow-giving lamps - * \param lar The vector of lamps - */ -void makeshadowbuf(struct Render *re, LampRen *lar); -void freeshadowbuf(struct LampRen *lar); - -void threaded_makeshadowbufs(struct Render *re); - -/** - * Determines the shadow factor for a face and lamp. There is some - * communication with global variables here. - * \return The shadow factors: 1.0 for no shadow, 0.0 for complete - * shadow. - * \param shb The shadowbuffer to find the shadow factor in. - * \param inp The inproduct between viewvector and ? - * - */ -float testshadowbuf(struct Render *re, struct ShadBuf *shb, const float rco[3], const float dxco[3], const float dyco[3], float inp, float mat_bias); - -/** - * Determines the shadow factor for lamp \a lar, between \a p1 and \a p2. (Which CS?) - */ -float shadow_halo(LampRen *lar, const float p1[3], const float p2[3]); - -/** - * Irregular shadowbuffer - */ - -struct MemArena; -struct APixstr; - -void ISB_create(RenderPart *pa, struct APixstr *apixbuf); -void ISB_free(RenderPart *pa); -float ISB_getshadow(ShadeInput *shi, ShadBuf *shb); - -/* data structures have to be accessible both in camview(x, y) as in lampview(x, y) */ -/* since they're created per tile rendered, speed goes over memory requirements */ - - -/* buffer samples, allocated in camera buffer and pointed to in lampbuffer nodes */ -typedef struct ISBSample { - float zco[3]; /* coordinate in lampview projection */ - short *shadfac; /* initialized zero = full lighted */ - int obi; /* object for face lookup */ - int facenr; /* index in faces list */ -} ISBSample; - -/* transparent version of buffer sample */ -typedef struct ISBSampleA { - float zco[3]; /* coordinate in lampview projection */ - short *shadfac; /* NULL = full lighted */ - int obi; /* object for face lookup */ - int facenr; /* index in faces list */ - struct ISBSampleA *next; /* in end, we want the first items to align with ISBSample */ -} ISBSampleA; - -/* used for transparent storage only */ -typedef struct ISBShadfacA { - struct ISBShadfacA *next; - int obi; - int facenr; - float shadfac; -} ISBShadfacA; - -/* What needs to be stored to evaluate shadow, for each thread in ShadBuf */ -typedef struct ISBData { - short *shadfacs; /* simple storage for solid only */ - ISBShadfacA **shadfaca; - struct MemArena *memarena; - int minx, miny, rectx, recty; /* copy from part disprect */ -} ISBData; - -#endif /* __SHADBUF_H__ */ - diff --git a/source/blender/render/intern/include/shading.h b/source/blender/render/intern/include/shading.h deleted file mode 100644 index 3ef6e9d7476..00000000000 --- a/source/blender/render/intern/include/shading.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * The Original Code is Copyright (C) 2006 Blender Foundation - * All rights reserved. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -/** \file blender/render/intern/include/shading.h - * \ingroup render - */ - - -struct ShadeInput; -struct ShadeResult; -struct RenderPart; -struct RenderLayer; -struct PixStr; -struct LampRen; -struct VlakRen; -struct StrandPoint; -struct ObjectInstanceRen; -struct Isect; - -/* shadeinput.c */ - -#define RE_MAX_OSA 16 - -/* needed to calculate shadow and AO for an entire pixel */ -typedef struct ShadeSample { - int tot; /* amount of shi in use, can be 1 for not FULL_OSA */ - - RenderLayer *rlpp[RE_MAX_OSA]; /* fast lookup from sample to renderlayer (fullsample buf) */ - - /* could be malloced once */ - ShadeInput shi[RE_MAX_OSA]; - ShadeResult shr[RE_MAX_OSA]; -} ShadeSample; - - - /* also the node shader callback */ -void shade_material_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, int obi, int facenr, int normal_flip); -void shade_input_copy_triangle(struct ShadeInput *shi, struct ShadeInput *from); -void shade_input_calc_viewco(struct ShadeInput *shi, float x, float y, float z, float view[3], float dxyview[2], float co[3], float dxco[3], float dyco[3]); -void shade_input_set_viewco(struct ShadeInput *shi, float x, float y, float sx, float sy, float z); -void shade_input_set_uv(struct ShadeInput *shi); -void shade_input_set_normals(struct ShadeInput *shi); -void shade_input_set_vertex_normals(struct ShadeInput *shi); -void shade_input_flip_normals(struct ShadeInput *shi); -void shade_input_set_shade_texco(struct ShadeInput *shi); -void shade_input_set_strand(struct ShadeInput *shi, struct StrandRen *strand, struct StrandPoint *spoint); -void shade_input_set_strand_texco(struct ShadeInput *shi, struct StrandRen *strand, struct StrandVert *svert, struct StrandPoint *spoint); -void shade_input_do_shade(struct ShadeInput *shi, struct ShadeResult *shr); - -void shade_input_init_material(struct ShadeInput *shi); -void shade_input_initialize(struct ShadeInput *shi, struct RenderPart *pa, struct RenderLayer *rl, int sample); - -void shade_sample_initialize(struct ShadeSample *ssamp, struct RenderPart *pa, struct RenderLayer *rl); -void shade_samples_do_AO(struct ShadeSample *ssamp); -void shade_samples_fill_with_ps(struct ShadeSample *ssamp, struct PixStr *ps, int x, int y); -int shade_samples(struct ShadeSample *ssamp, struct PixStr *ps, int x, int y); - -void vlr_set_uv_indices(struct VlakRen *vlr, int *i1, int *i2, int *i3); - -void calc_R_ref(struct ShadeInput *shi); - -void barycentric_differentials_from_position( - const float co[3], const float v1[3], const float v2[3], const float v3[3], - const float dxco[3], const float dyco[3], const float facenor[3], const bool differentials, - float *u, float *v, float *dx_u, float *dx_v, float *dy_u, float *dy_v); - -/* shadeoutput. */ -void shade_lamp_loop(struct ShadeInput *shi, struct ShadeResult *shr); - -void shade_color(struct ShadeInput *shi, ShadeResult *shr); - -void ambient_occlusion(struct ShadeInput *shi); -void environment_lighting_apply(struct ShadeInput *shi, struct ShadeResult *shr); - -ListBase *get_lights(struct ShadeInput *shi); -float lamp_get_visibility(struct LampRen *lar, const float co[3], float lv[3], float *dist); -void lamp_get_shadow(struct LampRen *lar, ShadeInput *shi, float inp, float shadfac[4], int do_real); - -float fresnel_fac(const float view[3], const float vn[3], 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/sss.h b/source/blender/render/intern/include/sss.h deleted file mode 100644 index 0952c6bff65..00000000000 --- a/source/blender/render/intern/include/sss.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 ***** - */ - -/** \file blender/render/intern/include/sss.h - * \ingroup render - */ - - -#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, const float co[3], float color[3]); -void scatter_tree_free(ScatterTree *tree); - -/* Internal renderer API */ - -struct Render; -struct Material; - -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, const float co[3], float color[3]); -int sss_pass_done(struct Render *re, struct Material *mat); - -#endif /*__SSS_H__*/ - diff --git a/source/blender/render/intern/include/strand.h b/source/blender/render/intern/include/strand.h deleted file mode 100644 index 5687ef3c837..00000000000 --- a/source/blender/render/intern/include/strand.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Contributor(s): Brecht Van Lommel. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -/** \file blender/render/intern/include/strand.h - * \ingroup render - */ - - -#ifndef __STRAND_H__ -#define __STRAND_H__ - -struct StrandVert; -struct StrandRen; -struct StrandBuffer; -struct ShadeSample; -struct StrandPart; -struct Render; -struct ZSpan; -struct ObjectInstanceRen; -struct StrandSurface; -struct DerivedMesh; -struct ObjectRen; - -typedef struct StrandPoint { - /* position within segment */ - float t; - - /* camera space */ - float co[3]; - float nor[3]; - float tan[3]; - float strandco; - float width; - - /* derivatives */ - float dtco[3], dsco[3]; - float dtstrandco; - - /* outer points */ - float co1[3], co2[3]; - float hoco1[4], hoco2[4]; - float zco1[3], zco2[3]; - int clip1, clip2; - - /* screen space */ - float hoco[4]; - float x, y; - - /* simplification */ - float alpha; -} StrandPoint; - -typedef struct StrandSegment { - struct StrandVert *v[4]; - struct StrandRen *strand; - struct StrandBuffer *buffer; - struct ObjectInstanceRen *obi; - float sqadaptcos; - - StrandPoint point1, point2; - int shaded; -} StrandSegment; - -struct StrandShadeCache; -typedef struct StrandShadeCache StrandShadeCache; - -void strand_eval_point(StrandSegment *sseg, StrandPoint *spoint); -void render_strand_segment(struct Render *re, float winmat[4][4], struct StrandPart *spart, struct ZSpan *zspan, int totzspan, StrandSegment *sseg); -void strand_minmax(struct StrandRen *strand, float min[3], float max[3], const float width); - -struct StrandSurface *cache_strand_surface(struct Render *re, struct ObjectRen *obr, struct DerivedMesh *dm, float mat[4][4], int timeoffset); -void free_strand_surface(struct Render *re); - -struct StrandShadeCache *strand_shade_cache_create(void); -void strand_shade_cache_free(struct StrandShadeCache *cache); -void strand_shade_segment(struct Render *re, struct StrandShadeCache *cache, struct StrandSegment *sseg, struct ShadeSample *ssamp, float t, float s, int addpassflag); -void strand_shade_unref(struct StrandShadeCache *cache, struct ObjectInstanceRen *obi, struct StrandVert *svert); - -#endif - diff --git a/source/blender/render/intern/include/sunsky.h b/source/blender/render/intern/include/sunsky.h deleted file mode 100644 index 60fa8aa51ba..00000000000 --- a/source/blender/render/intern/include/sunsky.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Contributor(s): zaghaghi - * - * ***** END GPL LICENSE BLOCK ***** - */ - -/** \file blender/render/intern/include/sunsky.h - * \ingroup render - */ - -#ifndef __SUNSKY_H__ -#define __SUNSKY_H__ - -// #define SPECTRUM_MAX_COMPONENTS 100 - -typedef struct SunSky { - short effect_type, skyblendtype, sky_colorspace; - float turbidity; - float theta, phi; - - float toSun[3]; - - /*float sunSpectralRaddata[SPECTRUM_MAX_COMPONENTS];*/ - float sunSolidAngle; - - float zenith_Y, zenith_x, zenith_y; - - float perez_Y[5], perez_x[5], perez_y[5]; - - /* suggested by glome in patch [#8063] */ - float horizon_brightness; - float spread; - float sun_brightness; - float sun_size; - float backscattered_light; - float skyblendfac; - float sky_exposure; - - float atm_HGg; - - float atm_SunIntensity; - float atm_InscatteringMultiplier; - float atm_ExtinctionMultiplier; - float atm_BetaRayMultiplier; - float atm_BetaMieMultiplier; - float atm_DistanceMultiplier; - - float atm_BetaRay[3]; - float atm_BetaDashRay[3]; - float atm_BetaMie[3]; - float atm_BetaDashMie[3]; - float atm_BetaRM[3]; -} SunSky; - -void InitSunSky(struct SunSky *sunsky, float turb, const float toSun[3], float horizon_brightness, - float spread, float sun_brightness, float sun_size, float back_scatter, - float skyblendfac, short skyblendtype, float sky_exposure, float sky_colorspace); - -void GetSkyXYZRadiance(struct SunSky *sunsky, float theta, float phi, float color_out[3]); -void GetSkyXYZRadiancef(struct SunSky *sunsky, const float varg[3], float color_out[3]); -void InitAtmosphere(struct SunSky *sunSky, float sun_intens, float mief, float rayf, float inscattf, float extincf, float disf); -void AtmospherePixleShader(struct SunSky *sunSky, float view[3], float s, float rgb[3]); -void ClipColor(float c[3]); - -#endif /*__SUNSKY_H__*/ diff --git a/source/blender/render/intern/include/texture.h b/source/blender/render/intern/include/texture.h index dfb491f46b0..71000e38960 100644 --- a/source/blender/render/intern/include/texture.h +++ b/source/blender/render/intern/include/texture.h @@ -63,29 +63,12 @@ } \ } \ -struct HaloRen; -struct ShadeInput; struct TexResult; struct Tex; struct Image; struct ImBuf; struct ImagePool; -/* texture.h */ - -void do_halo_tex(struct HaloRen *har, float xn, float yn, float col_r[4]); -void do_sky_tex( - const float rco[3], const float view[3], const float lo[3], const float dxyview[2], - float hor[3], float zen[3], float *blend, int skyflag, short thread); -void do_material_tex(struct ShadeInput *shi, struct Render *re); -void do_lamp_tex(LampRen *la, const float lavec[3], struct ShadeInput *shi, float col_r[3], int effect); -void do_volume_tex(struct ShadeInput *shi, const float xyz[3], int mapto_flag, float col_r[3], float *val, struct Render *re); - -void init_render_textures(Render *re); -void end_render_textures(Render *re); - -void render_realtime_texture(struct ShadeInput *shi, struct Image *ima); - /* imagetexture.h */ int imagewraposa(struct Tex *tex, struct Image *ima, struct ImBuf *ibuf, const float texvec[3], const float dxt[2], const float dyt[2], struct TexResult *texres, struct ImagePool *pool, const bool skip_load_image); diff --git a/source/blender/render/intern/include/texture_ocean.h b/source/blender/render/intern/include/texture_ocean.h deleted file mode 100644 index 4a71aff930a..00000000000 --- a/source/blender/render/intern/include/texture_ocean.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * Contributors: Matt Ebb - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#ifndef __TEXTURE_OCEAN_H__ -#define __TEXTURE_OCEAN_H__ - -/** \file blender/render/intern/include/texture_ocean.h - * \ingroup render - */ - -int ocean_texture(struct Tex *tex, const float texvec[2], struct TexResult *texres); - -#endif /* __TEXTURE_OCEAN_H__ */ diff --git a/source/blender/render/intern/include/volume_precache.h b/source/blender/render/intern/include/volume_precache.h deleted file mode 100644 index 9aa280d8276..00000000000 --- a/source/blender/render/intern/include/volume_precache.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 ***** - */ - -/** \file blender/render/intern/include/volume_precache.h - * \ingroup render - */ - - -void global_bounds_obi(Render *re, ObjectInstanceRen *obi, float bbmin[3], float bbmax[3]); -int point_inside_volume_objectinstance(Render *re, ObjectInstanceRen *obi, const float co[3]); - -void volume_precache(Render *re); -void free_volume_precache(Render *re); - -#define VOL_MS_TIMESTEP 0.1f diff --git a/source/blender/render/intern/include/volumetric.h b/source/blender/render/intern/include/volumetric.h deleted file mode 100644 index 3805478fed0..00000000000 --- a/source/blender/render/intern/include/volumetric.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 ***** - */ - -/** \file blender/render/intern/include/volumetric.h - * \ingroup render - */ - - -struct Isect; -struct ShadeInput; -struct ShadeResult; - -float vol_get_density(struct ShadeInput *shi, const float co[3]); -void vol_get_scattering(ShadeInput *shi, float scatter_col[3], const float co[3], const float view[3]); - -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 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 deleted file mode 100644 index dd2262e0357..00000000000 --- a/source/blender/render/intern/include/voxeldata.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 ***** - */ - -/** \file blender/render/intern/include/voxeldata.h - * \ingroup render - */ - -#ifndef __VOXELDATA_H__ -#define __VOXELDATA_H__ - -struct Render; -struct TexResult; - -typedef struct VoxelDataHeader { - int resolX, resolY, resolZ; - int frames; -} VoxelDataHeader; - -void cache_voxeldata(Tex *tex, int scene_frame); -void make_voxeldata(struct Render *re); -int voxeldatatex(struct Tex *tex, const float texvec[3], struct TexResult *texres); - -#endif /* __VOXELDATA_H__ */ diff --git a/source/blender/render/intern/include/zbuf.h b/source/blender/render/intern/include/zbuf.h index 6fc1a4c2656..1a93fc6c3b2 100644 --- a/source/blender/render/intern/include/zbuf.h +++ b/source/blender/render/intern/include/zbuf.h @@ -33,57 +33,6 @@ #ifndef __ZBUF_H__ #define __ZBUF_H__ -struct RenderPart; -struct RenderLayer; -struct LampRen; -struct ListBase; -struct ZSpan; -struct APixstrand; -struct APixstr; -struct StrandShadeCache; - -void fillrect(int *rect, int x, int y, int val); - -/** - * Converts a world coordinate into a homogeneous coordinate in view - * coordinates. - */ -void projectvert(const float v1[3], float winmat[4][4], float adr[4]); -void projectverto(const float v1[3], float winmat[4][4], float adr[4]); -int testclip(const float v[3]); - -void zbuffer_shadow(struct Render *re, float winmat[4][4], struct LampRen *lar, int *rectz, int size, float jitx, float jity); -void zbuffer_abuf_shadow(struct Render *re, struct LampRen *lar, float winmat[4][4], struct APixstr *APixbuf, struct APixstrand *apixbuf, struct ListBase *apsmbase, int size, int samples, float (*jit)[2]); -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); -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 APixstrand *apixbuf, struct ListBase *apsmbase, unsigned int lay, int negzmask, float winmat[4][4], int winx, int winy, int sample, float (*jit)[2], float clipcrop, int shadow, struct StrandShadeCache *cache); - -typedef struct APixstr { - unsigned short mask[4]; /* jitter mask */ - int z[4]; /* distance */ - int p[4]; /* index */ - int obi[4]; /* object instance */ - short shadfac[4]; /* optimize storage for irregular shadow */ - 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; - void *ps; -} APixstrMain; - /* span fill in method, is also used to localize data for zbuffering */ typedef struct ZSpan { int rectx, recty; /* range for clipping */ @@ -91,61 +40,13 @@ typedef struct ZSpan { int miny1, maxy1, miny2, maxy2; /* actual filled in range */ const float *minp1, *maxp1, *minp2, *maxp2; /* vertex pointers detect min/max range in */ float *span1, *span2; - - float zmulx, zmuly, zofsx, zofsy; /* transform from hoco to zbuf co */ - - int *rectz, *arectz; /* zbuffers, arectz is for transparent */ - int *rectz1; /* secondary z buffer for shadowbuffer (2nd closest z) */ - int *rectp; /* polygon index buffer */ - int *recto; /* object buffer */ - int *rectmask; /* negative zmask 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 */ - - void *sss_handle; /* used by sss */ - void (*sss_func)(void *, int, int, int, int, int); - - void (*zbuffunc)(struct ZSpan *, int, int, const float *, const float *, const float *, const float *); - void (*zbuflinefunc)(struct ZSpan *, int, int, const float *, const float *); - } ZSpan; -/* exported to shadbuf.c */ -void zbufclip4(struct ZSpan *zspan, int obi, int zvlnr, - const float f1[4], const float f2[4], const float f3[4], const float f4[4], - const int c1, const int c2, const int c3, const int c4); +void zbuf_alloc_span(struct ZSpan *zspan, int rectx, int recty); void zbuf_free_span(struct ZSpan *zspan); -void freepsA(struct ListBase *lb); -/* to rendercore.c */ void zspan_scanconvert(struct ZSpan *zpan, void *handle, float *v1, float *v2, float *v3, void (*func)(void *, int, int, float, float) ); -/* exported to edge render... */ -void zbufclip(struct ZSpan *zspan, int obi, int zvlnr, - const float f1[4], const float f2[4], const float f3[4], - const int c1, const int c2, const int c3); -void zbuf_alloc_span(struct ZSpan *zspan, int rectx, int recty, float clipcrop); -void zbufclipwire(struct ZSpan *zspan, int obi, int zvlnr, int ec, - const float ho1[4], const float ho2[4], const float ho3[4], const float ho4[4], - const int c1, const int c2, const int c3, const int c4); - -/* exported to shadeinput.c */ -void zbuf_make_winmat(Render *re, float winmat[4][4]); -void zbuf_render_project(float winmat[4][4], const float co[3], float ho[4]); - -/* should not really be exposed, bad! */ -void hoco_to_zco(ZSpan *zspan, float zco[3], const float hoco[4]); -void zspan_scanconvert_strand(ZSpan *zspan, void *handle, float *v1, float *v2, float *v3, void (*func)(void *, int, int, float, float, float) ); -void zbufsinglewire(ZSpan *zspan, int obi, int zvlnr, const float ho1[4], const float ho2[4]); - #endif |