Blender V2.61 - r43446
|
00001 /* 00002 * ***** BEGIN GPL LICENSE BLOCK ***** 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software Foundation, 00016 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 * 00018 * The Original Code is Copyright (C) 2006 Blender Foundation. 00019 * All rights reserved. 00020 * 00021 * The Original Code is: all of this file. 00022 * 00023 * Contributor(s): none yet. 00024 * 00025 * ***** END GPL LICENSE BLOCK ***** 00026 */ 00027 00033 #ifndef RENDERDATABASE_H 00034 #define RENDERDATABASE_H 00035 00036 struct Object; 00037 struct VlakRen; 00038 struct VertRen; 00039 struct HaloRen; 00040 struct Main; 00041 struct Material; 00042 struct Render; 00043 struct MCol; 00044 struct MTFace; 00045 struct CustomData; 00046 struct StrandBuffer; 00047 struct StrandRen; 00048 struct ObjectInstanceRen; 00049 struct RadFace; 00050 00051 #define RE_QUAD_MASK 0x7FFFFFF 00052 #define RE_QUAD_OFFS 0x8000000 00053 00054 /* render allocates totvert/256 of these nodes, for lookup and quick alloc */ 00055 typedef struct VertTableNode { 00056 struct VertRen *vert; 00057 float *rad; 00058 float *sticky; 00059 float *strand; 00060 float *tangent; 00061 float *stress; 00062 float *winspeed; 00063 } VertTableNode; 00064 00065 typedef struct VlakTableNode { 00066 struct VlakRen *vlak; 00067 struct MTFace *mtface; 00068 struct MCol *mcol; 00069 int totmtface, totmcol; 00070 float *surfnor; 00071 float *tangent; 00072 struct RadFace **radface; 00073 } VlakTableNode; 00074 00075 typedef struct StrandTableNode { 00076 struct StrandRen *strand; 00077 float *winspeed; 00078 float *surfnor; 00079 float *simplify; 00080 int *face; 00081 struct MCol *mcol; 00082 float *uv; 00083 int totuv, totmcol; 00084 } StrandTableNode; 00085 00086 /* renderdatabase.c */ 00087 void free_renderdata_tables(struct Render *re); 00088 void free_renderdata_vertnodes(struct VertTableNode *vertnodes); 00089 void free_renderdata_vlaknodes(struct VlakTableNode *vlaknodes); 00090 00091 void set_normalflags(struct Render *re, struct ObjectRen *obr); 00092 void project_renderdata(struct Render *re, void (*projectfunc)(const float *, float mat[][4], float *), int do_pano, float xoffs, int do_buckets); 00093 int clip_render_object(float boundbox[][3], float *bounds, float mat[][4]); 00094 00095 /* functions are not exported... so wrong names */ 00096 00097 struct VlakRen *RE_findOrAddVlak(struct ObjectRen *obr, int nr); 00098 struct VertRen *RE_findOrAddVert(struct ObjectRen *obr, int nr); 00099 struct StrandRen *RE_findOrAddStrand(struct ObjectRen *obr, int nr); 00100 struct HaloRen *RE_findOrAddHalo(struct ObjectRen *obr, int nr); 00101 struct HaloRen *RE_inithalo(struct Render *re, struct ObjectRen *obr, struct Material *ma, float *vec, float *vec1, float *orco, float hasize, float vectsize, int seed); 00102 struct HaloRen *RE_inithalo_particle(struct Render *re, struct ObjectRen *obr, struct DerivedMesh *dm, struct Material *ma, float *vec, float *vec1, float *orco, float *uvco, float hasize, float vectsize, int seed, float *pa_co); 00103 struct StrandBuffer *RE_addStrandBuffer(struct ObjectRen *obr, int totvert); 00104 00105 struct ObjectRen *RE_addRenderObject(struct Render *re, struct Object *ob, struct Object *par, int index, int psysindex, int lay); 00106 struct ObjectInstanceRen *RE_addRenderInstance(struct Render *re, struct ObjectRen *obr, struct Object *ob, struct Object *par, int index, int psysindex, float mat[][4], int lay); 00107 void RE_makeRenderInstances(struct Render *re); 00108 void RE_instanceTransformNormal(struct ObjectInstanceRen *obi, float *nor, float *tnor); 00109 00110 float *RE_vertren_get_sticky(struct ObjectRen *obr, struct VertRen *ver, int verify); 00111 float *RE_vertren_get_stress(struct ObjectRen *obr, struct VertRen *ver, int verify); 00112 float *RE_vertren_get_rad(struct ObjectRen *obr, struct VertRen *ver, int verify); 00113 float *RE_vertren_get_strand(struct ObjectRen *obr, struct VertRen *ver, int verify); 00114 float *RE_vertren_get_tangent(struct ObjectRen *obr, struct VertRen *ver, int verify); 00115 float *RE_vertren_get_winspeed(struct ObjectInstanceRen *obi, struct VertRen *ver, int verify); 00116 00117 struct MTFace *RE_vlakren_get_tface(struct ObjectRen *obr, VlakRen *ren, int n, char **name, int verify); 00118 struct MCol *RE_vlakren_get_mcol(struct ObjectRen *obr, VlakRen *ren, int n, char **name, int verify); 00119 float *RE_vlakren_get_surfnor(struct ObjectRen *obr, VlakRen *ren, int verify); 00120 float *RE_vlakren_get_nmap_tangent(struct ObjectRen *obr, VlakRen *ren, int verify); 00121 RadFace **RE_vlakren_get_radface(struct ObjectRen *obr, VlakRen *ren, int verify); 00122 void RE_vlakren_get_normal(struct Render *re, struct ObjectInstanceRen *obi, struct VlakRen *vlr, float *nor); 00123 00124 float *RE_strandren_get_surfnor(struct ObjectRen *obr, struct StrandRen *strand, int verify); 00125 float *RE_strandren_get_uv(struct ObjectRen *obr, struct StrandRen *strand, int n, char **name, int verify); 00126 struct MCol *RE_strandren_get_mcol(struct ObjectRen *obr, struct StrandRen *strand, int n, char **name, int verify); 00127 float *RE_strandren_get_simplify(struct ObjectRen *obr, struct StrandRen *strand, int verify); 00128 int *RE_strandren_get_face(struct ObjectRen *obr, struct StrandRen *strand, int verify); 00129 float *RE_strandren_get_winspeed(struct ObjectInstanceRen *obi, struct StrandRen *strand, int verify); 00130 00131 struct VertRen *RE_vertren_copy(struct ObjectRen *obr, struct VertRen *ver); 00132 struct VlakRen *RE_vlakren_copy(struct ObjectRen *obr, struct VlakRen *vlr); 00133 00134 void RE_set_customdata_names(struct ObjectRen *obr, struct CustomData *data); 00135 00136 /* haloren->type: flags */ 00137 #define HA_ONLYSKY 1 00138 #define HA_VECT 2 00139 #define HA_XALPHA 4 00140 #define HA_FLARECIRC 8 00141 00142 /* convertblender.c */ 00143 void init_render_world(Render *re); 00144 void RE_Database_FromScene_Vectors(Render *re, struct Main *bmain, struct Scene *sce, unsigned int lay); 00145 00146 00147 #endif /* RENDERDATABASE_H */ 00148