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>2005-11-14 17:27:44 +0300
committerTon Roosendaal <ton@blender.org>2005-11-14 17:27:44 +0300
commit8355aa0cf02e6b7abef823caa768aefe094e45b9 (patch)
tree051e14b6b1657e1c9b8fa158d4c000942a2a1c34 /source/blender/render/intern/include/zbuf.h
parent9bf198bbcab31c0a5e969e4f8c75a57e367c7154 (diff)
Strand render/zbuffering optimize recode
I've been going over the zbuf.c code, which is indeed very ancient, with a load of old optimizing and redundant code in use. Added more 'modern' Span support, which fills per face two arrays with the scanline information in it. That way you can zbuffer a quad in one run as well. It was also exactly that code that's copied all over in zbuf.c For now, to prevent issues for the release, the 'render a quad in 1 run' is only in use for the strand render. Tests reveil a speedup of about 33%. Will work on this recode later... which would also result in making zbuf.c threadsafe. And: bugfix #3398 When using the new 'render emitter' for particles, the orco array for particles was accidentally used by mesh too.
Diffstat (limited to 'source/blender/render/intern/include/zbuf.h')
-rw-r--r--source/blender/render/intern/include/zbuf.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/source/blender/render/intern/include/zbuf.h b/source/blender/render/intern/include/zbuf.h
index 003342ee9f1..bda21875848 100644
--- a/source/blender/render/intern/include/zbuf.h
+++ b/source/blender/render/intern/include/zbuf.h
@@ -165,7 +165,20 @@ int vergzvlak(const void *x1, const void *x2);
* @param c2
* @param c3
*/
-void zbufclip(int zvlnr, float *f1, float *f2, float *f3, int c1, int c2, int c3);
+
+/* span fill in method */
+typedef struct ZSpan {
+ int yres, miny, maxy;
+ int my0, my2; /* actual filled in range */
+ float *minp1, *maxp1, *minp2, *maxp2; /* vertex pointers detect min/max range in */
+ float *span1, *span2;
+} ZSpan;
+
+void zbufclip(struct ZSpan *zspan, int zvlnr, float *f1, float *f2, float *f3, int c1, int c2, int c3);
+
+/* These function pointers are used for z buffer filling. */
+extern void (*zbuffunc)(struct ZSpan *zspan, int, float *, float *, float *);
+extern void (*zbuflinefunc)(int, float *, float *);
/**
* same, for edges