~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to source/blender/render/extern/include/render.h

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2005-11-06 12:40:03 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051106124003-3pgs7tcg5rox96xg
Tags: 2.37a-1.1
* Non-maintainer upload.
* Split out parts of 01_SConstruct_debian.dpatch again: root_build_dir
  really needs to get adjusted before the clean target runs - closes: #333958,
  see #288882 for reference

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
 
 * $Id: render.h,v 1.8 2004/04/24 20:27:28 ton Exp $
 
2
 * $Id: render.h,v 1.16 2005/04/17 17:43:07 ton Exp $
3
3
 *
4
4
 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
5
5
 *
32
32
 */
33
33
 
34
34
#ifndef RENDER_H
35
 
#define RENDER_H "$Id: render.h,v 1.8 2004/04/24 20:27:28 ton Exp $"
 
35
#define RENDER_H
36
36
 
37
37
/* ------------------------------------------------------------------------- */
38
38
/* This little preamble might be moved to a separate include. It contains    */
40
40
/* fixes. I think it is risky to always include it...                        */
41
41
/* ------------------------------------------------------------------------- */
42
42
 
43
 
/* fix for OSA and defmaterial extern */
44
 
#include "BKE_osa_types.h"
45
 
#include "DNA_material_types.h"
46
43
 
47
44
#ifdef __cplusplus
48
45
extern "C" { 
49
46
#endif
50
47
 
51
 
/* For #undefs of stupid windows defines */
52
 
#ifdef WIN32
53
 
#include "BLI_winstuff.h"
54
 
#endif
55
 
 
56
48
/* ------------------------------------------------------------------------- */
57
49
/* Types                                                                     */
58
50
/* Both external and internal types can be placed here. Make sure there are  */
69
61
/* ------------------------------------------------------------------------- */
70
62
 
71
63
extern RE_Render         R;           /* rendercore.c */
72
 
extern Osa               O;           /* rendercore.c */
73
 
extern Material          defmaterial; /* initrender.c */
74
64
extern unsigned short   *igamtab1;    /* initrender.c */
75
65
extern unsigned short   *gamtab;      /* initrender.c */
76
66
 
80
70
/* Function definitions                                                      */
81
71
/*                                                                           */
82
72
/* All functions that need to be externally visible must be declared here.   */
83
 
/* Currently, this interface contains 29 functions and 11 callbacks.         */
 
73
/* Currently, this interface contains 38 functions and 11 callbacks.         */
84
74
/* ------------------------------------------------------------------------- */
85
75
 
86
76
 
88
78
/* shadbuf.c (1)                                                           */
89
79
/* ------------------------------------------------------------------------- */
90
80
 
 
81
/* only for renderconvertor */
91
82
void RE_initshadowbuf(struct LampRen *lar, float mat[][4]);
92
83
 
93
84
 
94
85
/* ------------------------------------------------------------------------- */
95
 
/* initrender (14)                                                           */
 
86
/* initrender (9)                                                           */
96
87
/* ------------------------------------------------------------------------- */
97
88
 
98
89
struct View3D;
107
98
void    RE_initrender(struct View3D *ogl_render_view3d);
108
99
 
109
100
/**
110
 
 *
 
101
 * only for renderconvertor
111
102
 */
112
103
void    RE_setwindowclip(int mode, int jmode);
113
104
 
117
108
 */
118
109
void    RE_animrender(struct View3D *ogl_render_view3d);
119
110
void    RE_free_render_data(void);
120
 
void    RE_free_filt_mask(void);
121
 
void    RE_init_filt_mask(void);
122
111
void    RE_init_render_data(void);
 
112
                /* jitterate is used by blenkernel effect */
123
113
void    RE_jitterate1(float *jit1, float *jit2, int num, float rad1);
124
114
void    RE_jitterate2(float *jit1, float *jit2, int num, float rad2);
125
115
void    RE_make_existing_file(char *name);
 
116
void    RE_floatbuffer_to_output(void);
126
117
 
127
118
/* ------------------------------------------------------------------------- */
128
119
/* zbuf (2)                                                                  */
151
142
 
152
143
 
153
144
/* ------------------------------------------------------------------------- */
154
 
/* texture                                                                    */
 
145
/* texture  (9)                                                                  */
155
146
/* ------------------------------------------------------------------------- */
156
147
struct MTex;
157
148
struct Tex;
161
152
void init_render_texture(struct Tex *tex);
162
153
void end_render_texture(struct Tex *tex);
163
154
 
164
 
void tubemap(float x, float y, float z, float *adr1, float *adr2);
165
 
void spheremap(float x, float y, float z, float *adr1, float *adr2);
166
 
 
167
155
void do_material_tex(ShadeInput *shi);
168
 
void externtex(struct MTex *mtex, float *vec);
169
 
void externtexcol(struct MTex *mtex, float *orco, char *col);
170
 
void do_lamp_tex(struct LampRen *la, float *lavec, ShadeInput *shi);
171
 
void do_sky_tex(float *);
172
 
 
173
 
int multitex(struct Tex *tex, float *texvec, float *dxt, float *dyt, int osatex);
174
 
 
 
156
void do_lamp_tex(struct LampRen *la, float *lavec, ShadeInput *shi, float *fcol);
 
157
 
 
158
int multitex_ext(struct Tex *tex, float *texvec, float *tin, float *tr, float *tg, float *tb, float *ta);
 
159
void externtex(struct MTex *mtex, float *vec, float *tin, float *tr, float *tg, float *tb, float *ta);
175
160
 
176
161
/* ------------------------------------------------------------------------- */
177
162
/* envmap (4)                                                                   */
178
163
/* ------------------------------------------------------------------------- */
179
 
        struct EnvMap;
180
 
        struct Tex;
 
164
struct EnvMap;
 
165
struct Tex;
 
166
 
181
167
void    RE_free_envmapdata(struct EnvMap *env);
182
168
void    RE_free_envmap(struct EnvMap *env);
183
169
struct EnvMap *RE_add_envmap(void);
184
170
/* these two maybe not external? yes, they are, for texture.c */
185
171
struct EnvMap *RE_copy_envmap(struct EnvMap *env);
186
172
 
187
 
        /* --------------------------------------------------------------------- */
188
 
        /* rendercore (2)                                                        */
189
 
        /* --------------------------------------------------------------------- */
190
 
        float Phong_Spec(float *n, float *l, float *v, int hard);
191
 
        float CookTorr_Spec(float *n, float *l, float *v, int hard);
192
 
        float Blinn_Spec(float *n, float *l, float *v, float refrac, float spec_power);
193
 
        float Toon_Spec( float *n, float *l, float *v, float size, float smooth);
194
 
        float OrenNayar_Diff(float *n, float *l, float *v, float rough);
195
 
        float Toon_Diff( float *n, float *l, float *v, float size, float smooth);
196
 
 
197
 
        /* --------------------------------------------------------------------- */
198
 
        /* renderdatabase (3)                                                    */
199
 
        /* --------------------------------------------------------------------- */
200
 
        struct VlakRen *RE_findOrAddVlak(int nr);
201
 
        struct VertRen *RE_findOrAddVert(int nr);
202
 
        struct HaloRen *RE_findOrAddHalo(int nr);
203
 
        HaloRen *RE_inithalo(Material *ma, 
204
 
                                          float *vec, 
205
 
                                          float *vec1, 
206
 
                                          float *orco, 
207
 
                                          float hasize, 
208
 
                                          float vectsize);
209
 
  
210
 
 
211
 
        /**
212
 
         * callbacks (11):
213
 
         *
214
 
         * If the callbacks aren't set, rendering will still proceed as
215
 
         * desired, but the concerning functionality will not be enabled.
216
 
         *
217
 
         * There need to be better uncoupling between the renderer and
218
 
         * these functions still!
219
 
         * */
220
 
        
221
 
        void RE_set_test_break_callback(int (*f)(void));
222
 
 
223
 
        void RE_set_timecursor_callback(void (*f)(int));
224
 
 
225
 
        void RE_set_renderdisplay_callback(void (*f)(int, int, int, int, unsigned int *));
226
 
        void RE_set_initrenderdisplay_callback(void (*f)(void));
227
 
        void RE_set_clearrenderdisplay_callback(void (*f)(short));
228
 
        
229
 
        void RE_set_printrenderinfo_callback(void (*f)(double,int));
230
 
 
231
 
        void RE_set_getrenderdata_callback(void (*f)(void));
232
 
        void RE_set_freerenderdata_callback(void (*f)(void));
233
 
        
234
 
 
235
 
        /*from renderhelp, should disappear!!! */ 
236
 
        /** Recalculate all normals on renderdata. */
237
 
        void set_normalflags(void);
238
 
        /**
239
 
         * On loan from zbuf.h:
240
 
         * Tests whether the first three coordinates should be clipped
241
 
         * wrt. the fourth component. Bits 1 and 2 test on x, 3 and 4 test on
242
 
         * y, 5 and 6 test on z:
243
 
         * xyz >  test => set first bit   (01),
244
 
         * xyz < -test => set second bit  (10),
245
 
         * xyz == test => reset both bits (00).
246
 
         * Note: functionality is duplicated from an internal function
247
 
         * Also called in: initrender.c, radfactors.c
248
 
         * @param  v [4 floats] a coordinate 
249
 
         * @return a vector of bitfields
250
 
         */
251
 
        int RE_testclip(float *v); 
252
 
 
253
 
        /* patch for the external if, to support the split for the ui */
254
 
        void RE_addalphaAddfac(char *doel, char *bron, char addfac);
255
 
        void RE_sky_char(float *view, char *col); 
256
 
        void RE_sky(float *view, float *col); 
257
 
        void RE_renderflare(struct HaloRen *har); 
258
 
        /**
259
 
         * Shade the pixel at xn, yn for halo har, and write the result to col. 
260
 
         * Also called in: previewrender.c
261
 
         * @param har    The halo to be rendered on this location
262
 
         * @param col    [unsigned int 3] The destination colour vector 
263
 
         * @param zz     Some kind of distance
264
 
         * @param dist   Square of the distance of this coordinate to the halo's center
265
 
         * @param x      [f] Pixel x relative to center
266
 
         * @param y      [f] Pixel y relative to center
267
 
         * @param flarec Flare counter? Always har->flarec...
268
 
         */
269
 
        void RE_shadehalo(struct HaloRen *har,
270
 
                                   char *col,
271
 
                                   unsigned int zz,
272
 
                                   float dist,
273
 
                                   float x,
274
 
                                   float y,
275
 
                                   short flarec); 
 
173
/* --------------------------------------------------------------------- */
 
174
/* rendercore (12)                                                        */
 
175
/* --------------------------------------------------------------------- */
 
176
float Phong_Spec(float *n, float *l, float *v, int hard);
 
177
float CookTorr_Spec(float *n, float *l, float *v, int hard);
 
178
float Blinn_Spec(float *n, float *l, float *v, float refrac, float spec_power);
 
179
float Toon_Spec( float *n, float *l, float *v, float size, float smooth);
 
180
float WardIso_Spec(float *n, float *l, float *v, float rms);
 
181
float OrenNayar_Diff(float *n, float *l, float *v, float rough);
 
182
float Toon_Diff( float *n, float *l, float *v, float size, float smooth);
 
183
float Minnaert_Diff( float nl, float *n, float *v, float darkness);
 
184
void add_to_diffuse(float *diff, ShadeInput *shi, float is, float r, float g, float b);
 
185
void ramp_diffuse_result(float *diff, ShadeInput *shi);
 
186
void do_specular_ramp(ShadeInput *shi, float is, float t, float *spec);
 
187
void ramp_spec_result(float *specr, float *specg, float *specb, ShadeInput *shi);
 
188
 
 
189
 
 
190
/* --------------------------------------------------------------------- */
 
191
/* renderdatabase (3)                                                    */
 
192
/* --------------------------------------------------------------------- */
 
193
struct VlakRen *RE_findOrAddVlak(int nr);
 
194
struct VertRen *RE_findOrAddVert(int nr);
 
195
struct HaloRen *RE_findOrAddHalo(int nr);
 
196
HaloRen *RE_inithalo(struct Material *ma, float *vec, float *vec1, float *orco, float hasize, 
 
197
                                        float vectsize, int seed);
 
198
 
 
199
/**
 
200
        * callbacks (11):
 
201
        *
 
202
        * If the callbacks aren't set, rendering will still proceed as
 
203
        * desired, but the concerning functionality will not be enabled.
 
204
        *
 
205
        * There need to be better uncoupling between the renderer and
 
206
        * these functions still!
 
207
        * */
 
208
 
 
209
void RE_set_test_break_callback(int (*f)(void));
 
210
 
 
211
void RE_set_timecursor_callback(void (*f)(int));
 
212
 
 
213
void RE_set_renderdisplay_callback(void (*f)(int, int, int, int, unsigned int *));
 
214
void RE_set_initrenderdisplay_callback(void (*f)(void));
 
215
void RE_set_clearrenderdisplay_callback(void (*f)(short));
 
216
 
 
217
void RE_set_printrenderinfo_callback(void (*f)(double,int));
 
218
 
 
219
void RE_set_getrenderdata_callback(void (*f)(void));
 
220
void RE_set_freerenderdata_callback(void (*f)(void));
 
221
 
 
222
 
 
223
/*from renderhelp, should disappear!!! */ 
 
224
/** Recalculate all normals on renderdata. */
 
225
void set_normalflags(void);
 
226
/**
 
227
        * On loan from zbuf.h:
 
228
        * Tests whether the first three coordinates should be clipped
 
229
        * wrt. the fourth component. Bits 1 and 2 test on x, 3 and 4 test on
 
230
        * y, 5 and 6 test on z:
 
231
        * xyz >  test => set first bit   (01),
 
232
        * xyz < -test => set second bit  (10),
 
233
        * xyz == test => reset both bits (00).
 
234
        * Note: functionality is duplicated from an internal function
 
235
        * Also called in: initrender.c, radfactors.c
 
236
        * @param  v [4 floats] a coordinate 
 
237
        * @return a vector of bitfields
 
238
        */
 
239
int RE_testclip(float *v); 
 
240
 
 
241
/* patch for the external if, to support the split for the ui */
 
242
void RE_addalphaAddfac(char *doel, char *bron, char addfac);
 
243
void RE_sky_char(float *view, char *col); 
 
244
void RE_renderflare(struct HaloRen *har); 
 
245
/**
 
246
        * Shade the pixel at xn, yn for halo har, and write the result to col. 
 
247
        * Also called in: previewrender.c
 
248
        * @param har    The halo to be rendered on this location
 
249
        * @param col    [char 4] The destination colour vector 
 
250
        * @param colf   [float 4] destination colour vector (need both)
 
251
        * @param zz     Some kind of distance
 
252
        * @param dist   Square of the distance of this coordinate to the halo's center
 
253
        * @param x      [f] Pixel x relative to center
 
254
        * @param y      [f] Pixel y relative to center
 
255
        * @param flarec Flare counter? Always har->flarec...
 
256
        */
 
257
void RE_shadehalo(struct HaloRen *har,
 
258
                                char *col, float *colf, 
 
259
                                int zz,
 
260
                                float dist,
 
261
                                float x,
 
262
                                float y,
 
263
                                short flarec); 
276
264
 
277
265
/***/
278
266