1
0
Fork 0
mirror of https://git.coom.tech/drummyfish/small3dlib.git synced 2024-11-24 21:09:57 +01:00

Update README.md

This commit is contained in:
Miloslav Číž 2019-06-25 15:05:16 +00:00
parent bb3d1fa5d6
commit c12fa1e9b3

View file

@ -12,21 +12,21 @@ TODO
## features
- Very fast, small and efficient.
- Uses only integer math (32bit).
- No dependencies (uses only stdint standard library), extremely portable.
- Single header, KISS.
- Pure C99, tested to run as C++ as well.
- Still flexible -- pixels are left for you to draw in any way you want with a custom fragment-shader like function.
- Perspective correction, 3 modes: none (linear only), full (per-pixel), approximation (per-N-pixels).
- Different drawing strategies to choose from: none, z-buffer (none, full, reduced), triangle sorting (back-to-front, fron-to-back with stencil buffer).
- Triangles provide barycentric coordinates, thanks to which practically anything that can be achieved with OpenGL can be achieved (texturing, shading, normal-mapping, texture fitering, transparency, PBR, shadow mapping, MIP mapping, ...).
- Tested on multiple platforms (TODO).
- Many compile-time options to tune the performance vs quality.
- Similar to OpenGL in principle, but simpler, easier to use, with higher-level features.
- Tools (Python scripts) for converting 3D models and textures to C array format used by the library.
- Well commented and formatted code.
- Completely free of legal restrictions, do literally anything you want.
- Very **fast, small and efficient**.
- Uses **only integer math** (32bit).
- **No dependencies** (uses only stdint standard library), extremely portable.
- **Single header**, KISS.
- **Pure C99**, tested to run as C++ as well.
- Still **flexible** -- pixels are left for you to draw in any way you want with a custom fragment-shader like function.
- **Perspective correction**, 3 modes: none (linear only), full (per-pixel), approximation (per-N-pixels).
- **Different drawing strategies** to choose from: none, z-buffer (none, full, reduced), triangle sorting (back-to-front, fron-to-back with stencil buffer).
- Triangles provide **barycentric coordinates**, thanks to which practically anything that can be achieved with OpenGL can be achieved (texturing, shading, normal-mapping, texture fitering, transparency, PBR, shadow mapping, MIP mapping, ...).
- **Tested on multiple platforms** (TODO).
- **Many compile-time options** to tune the performance vs quality.
- **Similar to OpenGL** in principle, but simpler, easier to use, with higher-level features.
- **Tools** (Python scripts) for converting 3D models and textures to C array format used by the library.
- **Well commented** and formatted code.
- Completely **free of legal restrictions**, do literally anything you want.
**NOTE**: Backwards compatibility isn't a goal of this libraray. It is meant to
be an as-is set of tools that the users is welcome to adjust for their
@ -35,12 +35,12 @@ interface.
## limitations
- Some values, like screen resolution, are a compile-time option due to performance and simplicity, and can't change during runtime.
- No scenegraph (object parenting), just a scene list. Parenting can still be achieved by using cutom transform matrices.
- Though performance is high, due to multiplatformness it can't match platform-specific rasterizers written in assembly.
- There is no far plane.
- There is a near plane, but a proper culling by it (subdividing triangles) is missing. You can either cull whole triangles completely or "push" them by the near plane. These options are okay when drawing a models not very close to the camera, but e.g. 3D environments may suffer from artifacts.
- Due to the limitations of 32bit integer arithmetics, some types of movement (particularly camera) may look jerky, and artifact may appear in specific situations.
- Some values, like screen resolution, are a compile-time option due to performance and simplicity, and **can't change during runtime**.
- **No scenegraph** (object parenting), just a scene list. Parenting can still be achieved by using cutom transform matrices.
- Though performance is high, due to multiplatformness it **probably can't match platform-specific rasterizers written in assembly**.
- There is **no far plane**.
- There is a near plane, but a **proper culling by it (subdividing triangles) is missing**. You can either cull whole triangles completely or "push" them by the near plane. These options are okay when drawing a models not very close to the camera, but e.g. 3D environments may suffer from artifacts.
- Due to the limitations of 32bit integer arithmetics, some types of movement (particularly camera) **may look jerky, and artifact may appear** in specific situations.
## how to use
@ -48,6 +48,7 @@ TODO
## tips/troubleshooting
- Don't forget to **compile with -O3!** This drastically improves performance.
- Seeing buggy triangles flashing in front of the camera? With the limited 32bit arithmetic far-away things may be overflowing. Try to scale down the scene. If you also don't mind it, set `S3L_STRICT_NEAR_CULLING` to `1` -- this should probably solve it.
- Seeing triangles disappear randomly in sorted modes? This is because the size of the memory for triangle sorting is limited by default -- increase `S3L_MAX_TRIANGLES_DRAWN`.
- Sorted mode sorts triangles before drawing, but sometimes you need to control the drawing order more precisely. This can be done by reordering the objects in the scene list or rendering the scene multiple times without clearing the screen.