Update
[less_retarded_wiki.git] / small3dlib.md
blobbee98b28c758645f5c7ef0cea0c8bda7fdef5841
1 # Small3dlib
3 Small3dlib (S3L) is a very portable [LRS](lrs.md)/[suckless](suckless.md) [single header](signle_header.md) 3D [software renderer](software_rendering.md) [library](library.md) written by [drummyfish](drummyfish.md) in the [C](c.md) programming language. It is very efficient and runs on many resource-limited computers such as embedded [open consoles](open_console.md). It is similar to [TinyGL](tinygl.md), but yet more simple. Small3dlib is [public domain](public_domain.md) [free software](free_software.md) under [CC0](cc0.md), written in under 3000 [lines of code](loc.md).
5 The repository is available at https://codeberg.org/drummyfish/small3dlib and https://gitlab.com/drummyfish/small3dlib.
7 Small3dlib can be used for rendering 3D graphics on almost any device as it is written in pure [C99](c99.md) without any software and hardware [dependencies](dependency.md); it doesn't use the standard library, [floating point](float.md) or [GPU](gpu.md). It is also very flexible, not forcing any preprogrammed [shaders](shader.md) -- instead it only computes which pixels should be rasterized and lets the programmer of the main application decide himself what should be done with these pixels (this is typically applying some [shading](shading.md) and writing them to screen).
9 Some of the rendering features include:
11 - different drawing strategies ([z-buffer](z_buffer.md), sorted rendering, ...)
12 - top-left rasterization rule (no holes between or overlaps of triangles)
13 - [perspective correction](perspective_correction.md) (either none, full or approximate)
14 - different near plane collision handling strategies (culling, clipping, shifting, ...)
16 ```
17                                                             ##x
18                                                          ####xx
19                                                       ######xxxx
20                 ..xx                               ########xxxxx
21              .....xxx                           ##########xxxxxx
22           .......xxxxx                       #############xxxxxxx
23           .......xxxxxxx                    #############xxxxxxxx
24           .......xxxxxxxx                  #############xxxxxxxxxx
25          .......xxxxxxxxxx                #############xxxxxxxxxxx
26          .......xxxxxxxxxxx              #############xxxxxxxxxxxx
27         ........xxxxxxxxxxxxx           ##############xxxxxxxxxxxxx
28         .......xxxxxxxxxxxxxxx         ##############xxxxxxxxxxxxxx
29         .......xxxxxxxxxxxxxxxx       ##############xxxxxxxxxxxxxxxx
30        ........xxxxxxxxxxxxxxxxx     ##############xxxxxxxxxxxxxxxxx
31        .......xxxxxxxxxxxxxxxxxx    ##############xxxxxxxxxxxxxxxxxx
32       ........xxxxxxxxxxxxxxxxxx   ................xxxxxxxxxxxxxxxxxx
33       ........xxxxxxxxxxxxxxxxxx    ................xxxxxxxxxxxxxxxxx
34       .......xxxxxxxxxxxxxxxxxx      ...............xxxxxxxxxxxxxxxxx
35      ........xxxxxxxxxxxxxxxxxx      ................xxxxxxxxxxxxxxxx
36      ........xxxxxxxxxxxxxxxxxx       ...............xxxxxxxxxxxxxxx
37     ........xxxxxxxxxxxxxxxxxxx        ...............xxxxxxxxxxxxxx
38     ........xxxxxxxxxxxxxxxxxx         ................xxxxxxxxxxxx
39     ........xxxxxxxxxxxxxxxxxx          ...............xxxxxxxxxxxx
40    ........xxxxxxxxxxxxxxxxxxx           ...............xxxxxxxxxx
41    ........xxxxxxxxxxxxxxxxxxx           ...............xxxxxxxxxx
42   .........xxxxxxxxxxxxxxxxxx             ...............xxxxxxxx
43          #xxxxxxxxxxxxxxxxxxx              ..............xxxxxxxx
44                #xxxxxxxxxxxxx              ...............xxxxxx
45                       xxxxxxx                 .............xxxxx
46                                                  ..........xxxx
47                                                     ........xxx
48                                                        .....xx
49                                                           ...x
50 ```
52 *Simple ASCII rendering made with small3dlib.*