Code Monkey home page Code Monkey logo

asciirend's Introduction

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.

asciirend's People

Contributors

h33p avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.