161
152
void init_render_texture(struct Tex *tex);
162
153
void end_render_texture(struct Tex *tex);
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);
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 *);
173
int multitex(struct Tex *tex, float *texvec, float *dxt, float *dyt, int osatex);
156
void do_lamp_tex(struct LampRen *la, float *lavec, ShadeInput *shi, float *fcol);
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);
176
161
/* ------------------------------------------------------------------------- */
178
163
/* ------------------------------------------------------------------------- */
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);
187
/* --------------------------------------------------------------------- */
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);
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,
214
* If the callbacks aren't set, rendering will still proceed as
215
* desired, but the concerning functionality will not be enabled.
217
* There need to be better uncoupling between the renderer and
218
* these functions still!
221
void RE_set_test_break_callback(int (*f)(void));
223
void RE_set_timecursor_callback(void (*f)(int));
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));
229
void RE_set_printrenderinfo_callback(void (*f)(double,int));
231
void RE_set_getrenderdata_callback(void (*f)(void));
232
void RE_set_freerenderdata_callback(void (*f)(void));
235
/*from renderhelp, should disappear!!! */
236
/** Recalculate all normals on renderdata. */
237
void set_normalflags(void);
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
251
int RE_testclip(float *v);
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);
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...
269
void RE_shadehalo(struct HaloRen *har,
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);
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);
202
* If the callbacks aren't set, rendering will still proceed as
203
* desired, but the concerning functionality will not be enabled.
205
* There need to be better uncoupling between the renderer and
206
* these functions still!
209
void RE_set_test_break_callback(int (*f)(void));
211
void RE_set_timecursor_callback(void (*f)(int));
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));
217
void RE_set_printrenderinfo_callback(void (*f)(double,int));
219
void RE_set_getrenderdata_callback(void (*f)(void));
220
void RE_set_freerenderdata_callback(void (*f)(void));
223
/*from renderhelp, should disappear!!! */
224
/** Recalculate all normals on renderdata. */
225
void set_normalflags(void);
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
239
int RE_testclip(float *v);
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);
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...
257
void RE_shadehalo(struct HaloRen *har,
258
char *col, float *colf,