Skip to main content

ascii rendering engine

Project description

asciirend

. ...    . . .  .  .     . . ..   ..  .. .  ..    .  . .. ... . . ...
.     . .       ..  ..  ...... . .   .......   .  ..  . .. ....... . ..
.  .   .   ... .. . =======+=+==+======+=====+======.  . ...            .
.   ....######======+================+=====+===+===+===+=+=+=+== .... ...
    . . .###%##########=============+===+=========++++++=====+      . . .
.     .  ..######%###%###%####%======+===++==++=+===+==+++++=..  .   . .
 ...    ... ##########%##%######%####=+==+======++++===+==+=. .  .  ...
  .. ..   . .#####%#######%####...........=+====+=====+=== ..    . .. ..
. ..... .  ... ##%####%%######%.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 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 directory for details.

Python

In addition, there is a python sample (and pip package). Please see python subdirectory for more details, or install asciirend package, and run the python sample at sample.py.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

asciirend-0.3.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

asciirend-0.3.0-py3-none-any.whl (501.8 kB view details)

Uploaded Python 3

File details

Details for the file asciirend-0.3.0.tar.gz.

File metadata

  • Download URL: asciirend-0.3.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for asciirend-0.3.0.tar.gz
Algorithm Hash digest
SHA256 5de5132a994715a6a7584a73b2e70da587340d0c65b49820db233de0a0ffcff5
MD5 d35d4243079cf4e1827332e81d312efe
BLAKE2b-256 520f2891049034caef5a0a42427b98eac75072b31e08b5d4995484a218b394fc

See more details on using hashes here.

File details

Details for the file asciirend-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: asciirend-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 501.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for asciirend-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cda690aa0bb1a3ce55fee68f847270fe4a35d5c80e05b8066fbb0b8f80a2869a
MD5 eb83dabc34f0315f8ed397273a625184
BLAKE2b-256 80d00092e845275871fb41be74ce5119450a3c60666e0fa546fe350eb381cfdb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page