Coder Social home page Coder Social logo

rayaccel's Introduction

rayBench is a simple raytracer designed to be run with different accelerator frameworks. It only does spheres and basic lighting for now, I might add more things later. Inspired by Gabriel Gambetta's Computer Graphics from Scratch.

To run, do ./a.out (input filename)

outputs PPM file to canvas.ppm, can be viewed by most image viewers...

The input file is loosly organized like this... displayX(int) displayY(int) (max 1024x768)

backgroundColor Red(int) backgroundColor Blue(int) backgroundColorGreen(int)

cameraX(double) cameraY(double) cameraZ(double)

viewWidth(double) viewHeight(double) viewDist(double) (usually 1 1 1)

nSpheres(int)

sphereX(double) sphereY(double) sphereZ(double) sphereColor red(int) sphereColor green(int) sphereColor blue(int) sphereRadius(double)

...

nLights(int)

lightType(int, 0=ambient, 1=point, 2=directional) lightDirectionX(double) lightDirectionY(double) lightDirectionZ(double) lightCenterX(double) lightCenterY(double) lightCenterZ(double) lightIntensity(double)

...

Animation program to generate 30fps animation of earth revloving around sun with the moon is in animation folder. rayBench_animated4.c is the most recent version that can be compiled with OpenACC. It should output 365 frames, with each frame representing a day. A folder titled 'output' must be in the same directory as the executeable. Run with the input fiile, solarSystem.q3d, as an argument.

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.