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-12-27 22:28:52 +0300
committerTon Roosendaal <ton@blender.org>2004-12-27 22:28:52 +0300
commit610cec55c7134c3dada168530ee833276677bae7 (patch)
tree428e061d0d42b79b9332688951baa3f189a3a985 /source/blender/render/extern
parentc43c38140d59e9204d55a62c87e0b701f50f2538 (diff)
Biiig commit! Thanks to 2-3 weeks of cvs freeze...
Render: - New; support for dual CPU render (SDL thread) Currently only works with alternating scanlines, but gives excellent performance. For both normal render as unified implemented. Note the "mutex" locks on z-transp buffer render and imbuf loads. - This has been made possible by major cleanups in render code, especially getting rid of globals (example Tin Tr Tg Tb Ta for textures) or struct OSA or using Materials or Texture data to write to. - Made normal render fully 4x32 floats too, and removed all old optimizes with chars or shorts. - Made normal render and unified render use same code for sky and halo render, giving equal (and better) results for halo render. Old render now also uses PostProcess options (brightness, mul, gamma) - Added option ("FBuf") in F10 Output Panel, this keeps a 4x32 bits buffer after render. Using PostProcess menu you will note an immediate re- display of image too (32 bits RGBA) - Added "Hue" and "Saturation" sliders to PostProcess options - Render module is still not having a "nice" API, but amount of dependencies went down a lot. Next todo: remove abusive "previewrender" code. The last main global in Render (struct Render) now can be re-used for fully controlling a render, to allow multiple "instances" of render to open. - Renderwindow now displays a smal bar on top with the stats, and keeps the stats after render too. Including "spare" page support. Not only easier visible that way, but also to remove the awkward code that was drawing stats in the Info header (extreme slow on some ATIs too) - Cleaned up blendef.h and BKE_utildefines.h, these two had overlapping defines. - I might have forgotten stuff... and will write a nice doc on the architecture!
Diffstat (limited to 'source/blender/render/extern')
-rw-r--r--source/blender/render/extern/include/render.h43
-rw-r--r--source/blender/render/extern/include/render_types.h64
2 files changed, 60 insertions, 47 deletions
diff --git a/source/blender/render/extern/include/render.h b/source/blender/render/extern/include/render.h
index d3953204678..209cf52b250 100644
--- a/source/blender/render/extern/include/render.h
+++ b/source/blender/render/extern/include/render.h
@@ -40,9 +40,6 @@
/* fixes. I think it is risky to always include it... */
/* ------------------------------------------------------------------------- */
-/* fix for OSA and defmaterial extern */
-#include "BKE_osa_types.h"
-#include "DNA_material_types.h"
#ifdef __cplusplus
extern "C" {
@@ -69,8 +66,6 @@ extern "C" {
/* ------------------------------------------------------------------------- */
extern RE_Render R; /* rendercore.c */
-extern Osa O; /* rendercore.c */
-extern Material defmaterial; /* initrender.c */
extern unsigned short *igamtab1; /* initrender.c */
extern unsigned short *gamtab; /* initrender.c */
@@ -80,7 +75,7 @@ struct View3D;
/* Function definitions */
/* */
/* All functions that need to be externally visible must be declared here. */
-/* Currently, this interface contains 29 functions and 11 callbacks. */
+/* Currently, this interface contains 38 functions and 11 callbacks. */
/* ------------------------------------------------------------------------- */
@@ -88,11 +83,12 @@ struct View3D;
/* shadbuf.c (1) */
/* ------------------------------------------------------------------------- */
+/* only for renderconvertor */
void RE_initshadowbuf(struct LampRen *lar, float mat[][4]);
/* ------------------------------------------------------------------------- */
-/* initrender (14) */
+/* initrender (9) */
/* ------------------------------------------------------------------------- */
struct View3D;
@@ -107,7 +103,7 @@ struct View3D;
void RE_initrender(struct View3D *ogl_render_view3d);
/**
- *
+ * only for renderconvertor
*/
void RE_setwindowclip(int mode, int jmode);
@@ -117,12 +113,12 @@ void RE_setwindowclip(int mode, int jmode);
*/
void RE_animrender(struct View3D *ogl_render_view3d);
void RE_free_render_data(void);
-void RE_free_filt_mask(void);
-void RE_init_filt_mask(void);
void RE_init_render_data(void);
+ /* jitterate is used by blenkernel effect */
void RE_jitterate1(float *jit1, float *jit2, int num, float rad1);
void RE_jitterate2(float *jit1, float *jit2, int num, float rad2);
void RE_make_existing_file(char *name);
+void RE_floatbuffer_to_output(void);
/* ------------------------------------------------------------------------- */
/* zbuf (2) */
@@ -151,7 +147,7 @@ void RE_zbufferall_radio(struct RadView *vw, struct RNode **rg_elem, int rg_t
/* ------------------------------------------------------------------------- */
-/* texture */
+/* texture (9) */
/* ------------------------------------------------------------------------- */
struct MTex;
struct Tex;
@@ -161,17 +157,11 @@ void end_render_textures(void);
void init_render_texture(struct Tex *tex);
void end_render_texture(struct Tex *tex);
-void tubemap(float x, float y, float z, float *adr1, float *adr2);
-void spheremap(float x, float y, float z, float *adr1, float *adr2);
-
void do_material_tex(ShadeInput *shi);
-void externtex(struct MTex *mtex, float *vec);
-void externtexcol(struct MTex *mtex, float *orco, char *col);
-void do_lamp_tex(struct LampRen *la, float *lavec, ShadeInput *shi);
-void do_sky_tex(float *);
-
-int multitex(struct Tex *tex, float *texvec, float *dxt, float *dyt, int osatex);
+void do_lamp_tex(struct LampRen *la, float *lavec, ShadeInput *shi, float *fcol);
+int multitex_ext(struct Tex *tex, float *texvec, float *tin, float *tr, float *tg, float *tb, float *ta);
+void externtex(struct MTex *mtex, float *vec, float *tin, float *tr, float *tg, float *tb, float *ta);
/* ------------------------------------------------------------------------- */
/* envmap (4) */
@@ -186,7 +176,7 @@ struct EnvMap *RE_add_envmap(void);
struct EnvMap *RE_copy_envmap(struct EnvMap *env);
/* --------------------------------------------------------------------- */
-/* rendercore (2) */
+/* rendercore (10) */
/* --------------------------------------------------------------------- */
float Phong_Spec(float *n, float *l, float *v, int hard);
float CookTorr_Spec(float *n, float *l, float *v, int hard);
@@ -206,9 +196,8 @@ void ramp_spec_result(float *specr, float *specg, float *specb, ShadeInput *shi)
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);
-
+HaloRen *RE_inithalo(struct Material *ma, float *vec, float *vec1, float *orco, float hasize,
+ float vectsize, int seed);
/**
* callbacks (11):
@@ -255,13 +244,13 @@ 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 col [char 4] The destination colour vector
+ * @param colf [float 4] destination colour vector (need both)
* @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
@@ -269,7 +258,7 @@ void RE_renderflare(struct HaloRen *har);
* @param flarec Flare counter? Always har->flarec...
*/
void RE_shadehalo(struct HaloRen *har,
- char *col,
+ char *col, float *colf,
unsigned int zz,
float dist,
float x,
diff --git a/source/blender/render/extern/include/render_types.h b/source/blender/render/extern/include/render_types.h
index 9f1fb9efef2..f8826228535 100644
--- a/source/blender/render/extern/include/render_types.h
+++ b/source/blender/render/extern/include/render_types.h
@@ -51,14 +51,48 @@
/* ------------------------------------------------------------------------- */
+/* localized texture result data */
+typedef struct TexResult {
+ float tin, tr, tg, tb, ta;
+ int talpha;
+ float *nor;
+} TexResult;
+
/* localized renderloop data */
typedef struct ShadeInput
{
- struct Material *mat, *matren;
+ struct Material *mat;
struct VlakRen *vlr;
float co[3];
+
+ /* copy from material, keep synced so we can do memcopy */
+ /* current size: 23*4 */
+ float r, g, b;
+ float specr, specg, specb;
+ float mirr, mirg, mirb;
+ float ambr, ambb, ambg;
+
+ float amb, emit, ang, spectra, ray_mirror;
+ float alpha, refl, spec, zoffs, add;
+ float translucency;
+ /* end direct copy from material */
+
+ /* individual copies: */
+ int har;
+
+ /* texture coordinates */
float lo[3], gl[3], uv[3], ref[3], orn[3], winco[3], sticky[3], vcol[3], rad[3];
float vn[3], view[3], refcol[4], displace[3];
+ /* dx/dy OSA coordinates */
+ float dxco[3], dyco[3];
+ float dxlo[3], dylo[3], dxgl[3], dygl[3], dxuv[3], dyuv[3];
+ float dxref[3], dyref[3], dxorn[3], dyorn[3];
+ float dxno[3], dyno[3], dxview, dyview;
+ float dxlv[3], dylv[3];
+ float dxwin[3], dywin[3];
+ float dxsticky[3], dysticky[3];
+ float dxrefract[3], dyrefract[3];
+
float xs, ys; /* pixel to be rendered */
short osatex;
int mask;
@@ -69,7 +103,7 @@ typedef struct ShadeInput
/* here only stuff to initalize the render itself */
typedef struct RE_Render
{
- float grvec[3], inprz, inprh;
+ float grvec[3];
float imat[3][3];
float viewmat[4][4], viewinv[4][4];
@@ -113,6 +147,7 @@ typedef struct RE_Render
unsigned int *rectspare; /* */
/* for 8 byte systems! */
long *rectdaps;
+ float *rectftot; /* original full color buffer */
short win, winpos, winx, winy, winxof, winyof;
short winpop, displaymode, sparex, sparey;
@@ -125,17 +160,6 @@ typedef struct RE_Render
/* ------------------------------------------------------------------------- */
-/**
- * Part as in part-rendering. An image rendered in parts is rendered
- * to a list of parts, with x,y size, and a pointer to the render
- * output stored per part. Internal!
- */
-typedef struct Part
-{
- struct Part *next, *prev;
- unsigned int *rect;
- short x, y;
-} Part;
typedef struct ShadBuf {
short samp, shadhalostep;
@@ -186,14 +210,14 @@ typedef struct RadFace {
typedef struct VlakRen
{
struct VertRen *v1, *v2, *v3, *v4;
+ unsigned int lay;
+ unsigned int raycount;
float n[3];
struct Material *mat;
struct TFace *tface;
unsigned int *vcol;
char snproj, puno;
char flag, ec;
- unsigned int lay;
- unsigned int raycount;
RadFace *radface;
Object *ob;
} VlakRen;
@@ -202,12 +226,12 @@ typedef struct VlakRen
typedef struct HaloRen
{
+ short miny, maxy;
float alfa, xs, ys, rad, radsq, sin, cos, co[3], no[3];
+ float hard, b, g, r;
unsigned int zs, zd;
- unsigned int zBufDist;/* depth in the z-buffer coordinate system */
- short miny, maxy;
- short hard, b, g, r;
- char starpoints, add, type, tex;
+ unsigned int zBufDist; /* depth in the z-buffer coordinate system */
+ char starpoints, type, add, tex;
char linec, ringc, seed;
short flarec; /* used to be a char. why ?*/
float hasize;
@@ -274,9 +298,9 @@ typedef struct LampRen
/* ray optim */
VlakRen *vlr_last;
- struct LampRen *org;
struct MTex *mtex[MAX_MTEX];
} LampRen;
+
#endif /* RENDER_TYPES_H */