X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=src%2Fpolyfill.c;h=e94de2f9c7b4b46855f957e39e3c90447ecd1900;hp=0d1351e1d26919b94b4f21e2749418f2aa4aa790;hb=9e546fcbdc870e396abeb6eaacaa7bc4054a61f0;hpb=0b870b76705b3e597da3f6a11e0499deedbeee30 diff --git a/src/polyfill.c b/src/polyfill.c index 0d1351e..e94de2f 100644 --- a/src/polyfill.c +++ b/src/polyfill.c @@ -60,6 +60,21 @@ void polyfill_wire(struct pvertex *verts, int nverts) #define NEXTIDX(x) (((x) - 1 + nverts) % nverts) #define PREVIDX(x) (((x) + 1) % nverts) +/* XXX + * When HIGH_QUALITY is defined, the rasterizer calculates slopes for attribute + * interpolation on each scanline separately; otherwise the slope for each + * attribute would be calculated once for the whole polygon, which is faster, + * but produces some slight quantization artifacts, due to the limited precision + * of fixed-point calculations. + */ +#undef HIGH_QUALITY + +/* extra bits of precision to use when interpolating colors. + * try tweaking this if you notice strange quantization artifacts. + */ +#define COLOR_SHIFT 12 + + #define POLYFILL polyfill_flat #define SCANEDGE scanedge_flat #undef GOURAUD