X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Frasterize;a=blobdiff_plain;f=config.h;h=cc552c2907a885854a55d21580d0daa06bfa819f;hp=a1d7fb9636dfb899bfcd0b90e5cf45f5a0e75ae3;hb=95850b98f73ad7033af60a30e324e9c3cda55389;hpb=34efcdbb29b75754fef5066c5999671bc2d2fb12 diff --git a/config.h b/config.h index a1d7fb9..cc552c2 100644 --- a/config.h +++ b/config.h @@ -21,6 +21,17 @@ #define IF_BACKFACE_CULLING(X) #endif +/* + * BLENDING + * If enabled, the blending function Crgb = (1 - Sa)Drgb + (Sa)Srgb is + * applied when determing color on the raster. + */ +#if BLENDING +#define IF_BLENDING(X) X +#else +#define IF_BLENDING(X) +#endif + /* * CLIPPING * If enabled, triangles will be not be drawn if they are entirely outside of @@ -135,22 +146,31 @@ #endif /* - * PRE_NORMALS - * If enabled, normals are pre-computed while the triangles are loading. - * Otherwise, the normals are computed during rasterization. The behavior of - * this option is effected by its precise value: - * 1 Normals are computed per-face, according to the right-hand rule and - * counter-clockwise winding of the verticies. - * 2 Normals are computed per-vertex; the normal for a vertex that is shared - * between two or more faces will be the average of the normals of the - * faces. There is a performance penalty for this setting. - * 3 Same as 2, but the normals will be cached so that they will not need to - * be computed the next time the mesh is loaded. + * CACHE_GEOMETRY + * If enabled, models will be saved to a quick-loading binary format after + * they are loaded. Or, if a cached version of a model is discovered when a + * model is requested to be loaded, it is loaded from the cache instead. This + * provides a decent speed improvement in cases where the model would + * otherwise be loaded from some kind of text format which would load slowly. + */ +#if CACHE_GEOMETRY +#define IF_CACHE_GEOMETRY(X) X +#else +#define IF_CACHE_GEOMETRY(X) +#endif + +/* + * CALC_NORMALS + * If enabled, per-vertex normals are calculated for models that don't come + * with pre-computed normals. This occurs at loading time. The normals are + * calculated by averaging the true normals of all the faces shared by each + * vertex. Otherwise, only per-face normals are calculated for such models, + * also at loading time. */ -#if PRE_NORMALS -#define IF_PRE_NORMALS(X) X +#if CALC_NORMALS +#define IF_CALC_NORMALS(X) X #else -#define IF_PRE_NORMALS(X) +#define IF_CALC_NORMALS(X) #endif /*