Giter Club home page Giter Club logo

loltracer's Introduction

LOLTracer

alt tag

Setup

The following LOLCODE was written and executed using lci v0.10.5. It uses v1.3 of the specification as implemented in that version of lci. Compatibility with other LOLCODE compilers and interpreters is not guaranteed (nor is it very likely).

Download and install lci here:

https://github.com/justinmeza/lci/releases/tag/v0.10.5

Since v1.3 of LOLCODE is not official, (the latest version on lolcode.org as of this writing is 1.2), it is recommended that you check the following website, or the lci google group, for the ways in which v1.3 differs from v1.2:

https://web.archive.org/web/20120420194728/http://lolcode.com/proposals/1.3/bukkit2

Usage

For Windows or Linux, run the following from the command line:

lci.exe LOLTracer.lol > LOLrender.ppm

Expect several hours render time for the image to complete with default settings. On my home desktop with a Quad Core 2.4 Ghz CPU it took approximately 40 hours to complete. If you would like faster results, I recommend changing the number of rays used from 64 to a lower number. However since the pixel color is accumulated over many samples, the resulting image will be darker. If you lower the number of rays, I also recommend increasing the default colors for the ground and sky by a proportional amount.

Background

The LOLtracer was written, on a dare, to see if it would be possible to implement a raytracer in LOLCODE. I am happy to report that it is VERY MUCH possible, although not terribly fast. The LOLtracer also attempts to be as faithful as possible to the implementation of Andrew Kensler's business card raytracer:

http://fabiensanglard.net/rayTracing_back_of_business_card/

Additional information about his raytracer can be found here:

https://news.ycombinator.com/item?id=6425965

And a python version of his raytracer by Ivo van der Wijk can also be found here:

http://vanderwijk.info/blog/business-card-raytracer-in-python/

Most of the challenge in faithfully reproducing Kensler's raytracer in LOLCODE lay in finding ways to have access to the same standard library of functions available in C that are used in the business card raytracer. v1.3 of LOLCODE does not have bindings for C standard lib, so I was forced to re-write many common routines in LOLCODE as a substitute. These included sqrt(), rand(), ceil(), and pow(). Originally I tried to recreate bitshift left and bitwise and as well, but those operations proved far too slow even for LOLCODE. Even though they are no longer called, those functions are left in for posterity.

Author

Logan Kelly ([email protected])

Date

Sept. 17th, 2014

loltracer's People

Contributors

logankelly avatar orangixx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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