Giter VIP home page Giter VIP logo

ascii-renderer's Introduction

ASCII Renderer

View the demo here

Earth demo

Simulates an ASCII art style using a three.js renderer and an SVG mask.

By using a semi transparent SVG mask that doesn't update at runtime frame rate is drastically improved over alternative methods such as the ascii effect example (which was the original inspiration for this project). The limitation of this method is that updating the text or the viewport size is an expensive operation so they can't change often.

How to use

Grab ascii-renderer.js or the minified version and set it up according to the example in index.html. There are code docs in the js.

var renderer = new THREE.WebGLRenderer();
// This step is important, the renderer must have a parent
container.appendChild(renderer.domElement);

var asciiRenderer = new AsciiRenderer(renderer, {
    charSet: '010011',
    opacity: 0.7,
});

Development

Use npm install to set up dependencies. You can start a dev server with npm run start and minify with npm run start. If you use VS Code you can also use the shortcut ctrl+shift+B to start the dev server.

TODO: list

  1. Toon lighting has issues when viewed from behind. Try a custom lighting model.
  2. Test font ratio detection so that any monospace font can be used.
  3. Remove unnecessary <tspan> at the end of the text mask.

ascii-renderer's People

Contributors

deovolentegames 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.