Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/h33p/asciirend
Generic no_std compatible ascii renderer
https://github.com/h33p/asciirend
Last synced: 8 days ago
JSON representation
Generic no_std compatible ascii renderer
- Host: GitHub
- URL: https://github.com/h33p/asciirend
- Owner: h33p
- License: mit
- Created: 2023-11-22T09:24:58.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2023-12-21T18:57:33.000Z (11 months ago)
- Last Synced: 2024-10-28T12:13:39.623Z (18 days ago)
- Language: Rust
- Size: 63.5 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# asciirend
```text
. ... . . . . . . . .. .. .. . .. . . .. ... . . ...
. . . .. .. ...... . . ....... . .. . .. ....... . ..
. . . ... .. . =======+=+==+======+=====+======. . ... .
. ....######======+================+=====+===+===+===+=+=+=+== .... ...
. . .###%##########=============+===+=========++++++=====+ . . .
. . ..######%###%###%####%======+===++==++=+===+==+++++=.. . . .
... ... ##########%##%######%####=+==+======++++===+==+=. . . ...
.. .. . .#####%#######%####...........=+====+=====+=== .. . .. ..
. ..... . ... ##%####%%######%.asciirend.======+=+==+=== . .... ..... .
.. .. . . ##########%####...........+========+==== .. ... .
. . .. . ##%##############%##=+++======+==+=== .. ... .. .. ..
.. .... . .##################=+=====++===+==+ . . . .
. ... . ... #%####%#####%###==+=+==+=+++== ... . ... ..
. .. . . ... . .. .. ##########%%##+===++===+=+ . . .. .. ..
. . . .. . .. . ############+===+=++==. . . .. . .. .
. . . . . . . ... ##########+==++=++ ..... . . . . . . .
.... .. ... .... .. #%#####%==+=== .. . . .. .. . .... ..
.. . ... .. .. .. ... ..##%###+=== . ... . .. . . . .
```## Generic ascii renderer
`asciirend` is a `no_std` compatible 3D rendering core. This crate renders objects in several
stages:- Primitive shading (similar to vertex shading, albeit works on whole primitives).
- Fragment shading.
- Additional text pass.Fragments are shaded in full sRGB float color space, which then is quantized to characters with a
dithering algorithm. This allows the image to have clearer color transitions, as opposed to direct
character shading. This also means the rendering backend is agnostic to the available color space
(so long as it's not HDR!), which is important for a generic `no_std` compatible renderer.## Examples
Please see [`examples/sample.rs`](examples/sample.rs) for usage sample.
### JavaScript
`asciirend` has a javascript sample that uses WASM. Albeit the API surface is limited, it is
possible to use it to draw basic interactive scenes. Please see [`web_sample`](web_sample/)
directory for details.### Python
In addition, there is a python sample (and pip package). Please see [`python`](python/)
subdirectory for more details, or install `asciirend` package, and run the python sample at
[`sample.py`](sample.py).