|
Blender
V2.59
|
00001 /* 00002 * rendercore_ext.h 00003 * 00004 * $Id: rendercore.h 35233 2011-02-27 19:31:27Z jesterking $ 00005 * 00006 * ***** BEGIN GPL LICENSE BLOCK ***** 00007 * 00008 * This program is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU General Public License 00010 * as published by the Free Software Foundation; either version 2 00011 * of the License, or (at your option) any later version. 00012 * 00013 * This program is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with this program; if not, write to the Free Software Foundation, 00020 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00021 * 00022 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. 00023 * All rights reserved. 00024 * 00025 * The Original Code is: all of this file. 00026 * 00027 * Contributor(s): none yet. 00028 * 00029 * ***** END GPL LICENSE BLOCK ***** 00030 */ 00031 00037 #ifndef RENDERCORE_H 00038 #define RENDERCORE_H 00039 00040 #include "render_types.h" 00041 00042 00043 /* vector defines */ 00044 00045 #define CROSS(dest, a, b) { dest[0]= a[1] * b[2] - a[2] * b[1]; dest[1]= a[2] * b[0] - a[0] * b[2]; dest[2]= a[0] * b[1] - a[1] * b[0]; } 00046 #define VECMUL(dest, f) { dest[0]*= f; dest[1]*= f; dest[2]*= f; } 00047 00048 struct HaloRen; 00049 struct ShadeInput; 00050 struct ShadeResult; 00051 struct World; 00052 struct RenderPart; 00053 struct RenderLayer; 00054 struct ObjectRen; 00055 struct ListBase; 00056 struct RayObject; 00057 00058 /* ------------------------------------------------------------------------- */ 00059 00060 typedef struct PixStr 00061 { 00062 struct PixStr *next; 00063 int obi, facenr, z, maskz; 00064 unsigned short mask; 00065 short shadfac; 00066 } PixStr; 00067 00068 typedef struct PixStrMain 00069 { 00070 struct PixStrMain *next, *prev; 00071 struct PixStr *ps; 00072 int counter; 00073 } PixStrMain; 00074 00075 /* ------------------------------------------------------------------------- */ 00076 00077 00078 void calc_view_vector(float *view, float x, float y); 00079 float mistfactor(float zcor, float *co); /* dist and height, return alpha */ 00080 00081 void renderspothalo(struct ShadeInput *shi, float *col, float alpha); 00082 void add_halo_flare(Render *re); 00083 00084 void calc_renderco_zbuf(float *co, float *view, int z); 00085 void calc_renderco_ortho(float *co, float x, float y, int z); 00086 00087 int count_mask(unsigned short mask); 00088 00089 void zbufshade(void); 00090 void zbufshadeDA(void); /* Delta Accum Pixel Struct */ 00091 00092 void zbufshade_tile(struct RenderPart *pa); 00093 void zbufshadeDA_tile(struct RenderPart *pa); 00094 00095 void zbufshade_sss_tile(struct RenderPart *pa); 00096 00097 int get_sample_layers(struct RenderPart *pa, struct RenderLayer *rl, struct RenderLayer **rlpp); 00098 00099 00100 /* -------- ray.c ------- */ 00101 00102 extern void freeraytree(Render *re); 00103 extern void makeraytree(Render *re); 00104 struct RayObject* makeraytree_object(Render *re, ObjectInstanceRen *obi); 00105 00106 extern void ray_shadow(ShadeInput *, LampRen *, float *); 00107 extern void ray_trace(ShadeInput *, ShadeResult *); 00108 extern void ray_ao(ShadeInput *, float *, float *); 00109 extern void init_jitter_plane(LampRen *lar); 00110 extern void init_ao_sphere(struct World *wrld); 00111 extern void init_render_qmcsampler(Render *re); 00112 extern void free_render_qmcsampler(Render *re); 00113 00114 #endif /* RENDER_EXT_H */ 00115