Blender V2.61 - r43446

rendercore.h

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