Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2004-06-30 22:54:09 +0400
committerTon Roosendaal <ton@blender.org>2004-06-30 22:54:09 +0400
commita8ef804146751f8b5ec0f83b411f4ab7d041ed84 (patch)
treee85a6e52b41f7774cf472171ee11783324eec991 /source/blender/render/extern
parentc9b4585618ea72f61c4671d4734c9e48b6ce6745 (diff)
NEW: Ramp shades for diffuse and specular
http://www.blender3d.org/cms/Ramp_Shaders.348.0.html Material color and specular now can be defined by a Colorband. The actual color then is defined during shading based on: - shade value (like dotproduct) - energy value (dot product plus light) - normal - result of all shading (useful for adding stuff in the end) Special request from [A]ndy! :)
Diffstat (limited to 'source/blender/render/extern')
-rw-r--r--source/blender/render/extern/include/render.h184
1 files changed, 93 insertions, 91 deletions
diff --git a/source/blender/render/extern/include/render.h b/source/blender/render/extern/include/render.h
index c27e35fd1cf..d3953204678 100644
--- a/source/blender/render/extern/include/render.h
+++ b/source/blender/render/extern/include/render.h
@@ -176,103 +176,105 @@ int multitex(struct Tex *tex, float *texvec, float *dxt, float *dyt, int osatex)
/* ------------------------------------------------------------------------- */
/* envmap (4) */
/* ------------------------------------------------------------------------- */
- struct EnvMap;
- struct Tex;
+struct EnvMap;
+struct Tex;
+
void RE_free_envmapdata(struct EnvMap *env);
void RE_free_envmap(struct EnvMap *env);
struct EnvMap *RE_add_envmap(void);
/* these two maybe not external? yes, they are, for texture.c */
struct EnvMap *RE_copy_envmap(struct EnvMap *env);
- /* --------------------------------------------------------------------- */
- /* rendercore (2) */
- /* --------------------------------------------------------------------- */
- float Phong_Spec(float *n, float *l, float *v, int hard);
- float CookTorr_Spec(float *n, float *l, float *v, int hard);
- float Blinn_Spec(float *n, float *l, float *v, float refrac, float spec_power);
- float Toon_Spec( float *n, float *l, float *v, float size, float smooth);
- float OrenNayar_Diff(float *n, float *l, float *v, float rough);
- float Toon_Diff( float *n, float *l, float *v, float size, float smooth);
-
- /* --------------------------------------------------------------------- */
- /* renderdatabase (3) */
- /* --------------------------------------------------------------------- */
- struct VlakRen *RE_findOrAddVlak(int nr);
- struct VertRen *RE_findOrAddVert(int nr);
- struct HaloRen *RE_findOrAddHalo(int nr);
- HaloRen *RE_inithalo(Material *ma,
- float *vec,
- float *vec1,
- float *orco,
- float hasize,
- float vectsize);
-
-
- /**
- * callbacks (11):
- *
- * If the callbacks aren't set, rendering will still proceed as
- * desired, but the concerning functionality will not be enabled.
- *
- * There need to be better uncoupling between the renderer and
- * these functions still!
- * */
-
- void RE_set_test_break_callback(int (*f)(void));
-
- void RE_set_timecursor_callback(void (*f)(int));
-
- void RE_set_renderdisplay_callback(void (*f)(int, int, int, int, unsigned int *));
- void RE_set_initrenderdisplay_callback(void (*f)(void));
- void RE_set_clearrenderdisplay_callback(void (*f)(short));
-
- void RE_set_printrenderinfo_callback(void (*f)(double,int));
-
- void RE_set_getrenderdata_callback(void (*f)(void));
- void RE_set_freerenderdata_callback(void (*f)(void));
-
-
- /*from renderhelp, should disappear!!! */
- /** Recalculate all normals on renderdata. */
- void set_normalflags(void);
- /**
- * On loan from zbuf.h:
- * Tests whether the first three coordinates should be clipped
- * wrt. the fourth component. Bits 1 and 2 test on x, 3 and 4 test on
- * y, 5 and 6 test on z:
- * xyz > test => set first bit (01),
- * xyz < -test => set second bit (10),
- * xyz == test => reset both bits (00).
- * Note: functionality is duplicated from an internal function
- * Also called in: initrender.c, radfactors.c
- * @param v [4 floats] a coordinate
- * @return a vector of bitfields
- */
- int RE_testclip(float *v);
-
- /* patch for the external if, to support the split for the ui */
- void RE_addalphaAddfac(char *doel, char *bron, char addfac);
- void RE_sky_char(float *view, char *col);
- void RE_sky(float *view, float *col);
- void RE_renderflare(struct HaloRen *har);
- /**
- * Shade the pixel at xn, yn for halo har, and write the result to col.
- * Also called in: previewrender.c
- * @param har The halo to be rendered on this location
- * @param col [unsigned int 3] The destination colour vector
- * @param zz Some kind of distance
- * @param dist Square of the distance of this coordinate to the halo's center
- * @param x [f] Pixel x relative to center
- * @param y [f] Pixel y relative to center
- * @param flarec Flare counter? Always har->flarec...
- */
- void RE_shadehalo(struct HaloRen *har,
- char *col,
- unsigned int zz,
- float dist,
- float x,
- float y,
- short flarec);
+/* --------------------------------------------------------------------- */
+/* rendercore (2) */
+/* --------------------------------------------------------------------- */
+float Phong_Spec(float *n, float *l, float *v, int hard);
+float CookTorr_Spec(float *n, float *l, float *v, int hard);
+float Blinn_Spec(float *n, float *l, float *v, float refrac, float spec_power);
+float Toon_Spec( float *n, float *l, float *v, float size, float smooth);
+float OrenNayar_Diff(float *n, float *l, float *v, float rough);
+float Toon_Diff( float *n, float *l, float *v, float size, float smooth);
+void add_to_diffuse(float *diff, ShadeInput *shi, float is, float r, float g, float b);
+void ramp_diffuse_result(float *diff, ShadeInput *shi);
+void do_specular_ramp(ShadeInput *shi, float is, float t, float *spec);
+void ramp_spec_result(float *specr, float *specg, float *specb, ShadeInput *shi);
+
+
+/* --------------------------------------------------------------------- */
+/* renderdatabase (3) */
+/* --------------------------------------------------------------------- */
+struct VlakRen *RE_findOrAddVlak(int nr);
+struct VertRen *RE_findOrAddVert(int nr);
+struct HaloRen *RE_findOrAddHalo(int nr);
+HaloRen *RE_inithalo(Material *ma, float *vec, float *vec1, float *orco, float hasize,
+ float vectsize);
+
+
+/**
+ * callbacks (11):
+ *
+ * If the callbacks aren't set, rendering will still proceed as
+ * desired, but the concerning functionality will not be enabled.
+ *
+ * There need to be better uncoupling between the renderer and
+ * these functions still!
+ * */
+
+void RE_set_test_break_callback(int (*f)(void));
+
+void RE_set_timecursor_callback(void (*f)(int));
+
+void RE_set_renderdisplay_callback(void (*f)(int, int, int, int, unsigned int *));
+void RE_set_initrenderdisplay_callback(void (*f)(void));
+void RE_set_clearrenderdisplay_callback(void (*f)(short));
+
+void RE_set_printrenderinfo_callback(void (*f)(double,int));
+
+void RE_set_getrenderdata_callback(void (*f)(void));
+void RE_set_freerenderdata_callback(void (*f)(void));
+
+
+/*from renderhelp, should disappear!!! */
+/** Recalculate all normals on renderdata. */
+void set_normalflags(void);
+/**
+ * On loan from zbuf.h:
+ * Tests whether the first three coordinates should be clipped
+ * wrt. the fourth component. Bits 1 and 2 test on x, 3 and 4 test on
+ * y, 5 and 6 test on z:
+ * xyz > test => set first bit (01),
+ * xyz < -test => set second bit (10),
+ * xyz == test => reset both bits (00).
+ * Note: functionality is duplicated from an internal function
+ * Also called in: initrender.c, radfactors.c
+ * @param v [4 floats] a coordinate
+ * @return a vector of bitfields
+ */
+int RE_testclip(float *v);
+
+/* patch for the external if, to support the split for the ui */
+void RE_addalphaAddfac(char *doel, char *bron, char addfac);
+void RE_sky_char(float *view, char *col);
+void RE_sky(float *view, float *col);
+void RE_renderflare(struct HaloRen *har);
+/**
+ * Shade the pixel at xn, yn for halo har, and write the result to col.
+ * Also called in: previewrender.c
+ * @param har The halo to be rendered on this location
+ * @param col [unsigned int 3] The destination colour vector
+ * @param zz Some kind of distance
+ * @param dist Square of the distance of this coordinate to the halo's center
+ * @param x [f] Pixel x relative to center
+ * @param y [f] Pixel y relative to center
+ * @param flarec Flare counter? Always har->flarec...
+ */
+void RE_shadehalo(struct HaloRen *har,
+ char *col,
+ unsigned int zz,
+ float dist,
+ float x,
+ float y,
+ short flarec);
/***/