Giter Club home page Giter Club logo

cse5280_raytracing's Introduction

CSE 5280 (Computer Graphics): Ray Tracing Assignment

@Author: Ruksana Kabealo

Description

In this assignment, I implemented a ray tracer that renders a scene with three spheres and two planes. The scene is lit by a single point light source. The objects in the scene are shaded using the Phong reflection model.

How to Run

The code is provided in the included Jupyter Notebook. Running the code as is will produce 200 512x512 PNGs of the rendered scene as the light source moves in a parabolic arc described by v = -0.00024*u^2 + 240 + 0.0001 (from point (0.0001, 0.0001, -999.9999) to point (0.0001, 4.776099999999982, 990.0001), reaching a maximum height at point (0.0001, 240.0001, 0.0001)) from behind the objects to behind the camera. Note that the w coordinate is fixed at 0.0001, so the light source only moves up/down and back/forth and never left/right. This animated light source is meant to mimic the cycle of the sun rising and setting.

All images are not included in the repository due to their size, but all images can be generated by running the code. To generate all 200 images, the code takes approximately 5 minutes * 200 images = 1000 minutes = 16.67 hours to run on my machine. Alternatively, in Google Collab the code takes approximately 1 minute * 200 images = 200 minutes = 3.33 hours to run.

An animation of all the images stitched together is hosted at the following link: https://www.youtube.com/shorts/dhx-upeSCUI

Example Images

The first image in the video. Here, the light source is located at the starting point of its parabolic arc (behind the objects).

An image from 1/4 of the way through the video. Here, the light source is located halfway between the starting point and the maximum height of the parabolic arc.

An image from 1/2 of the way through the video. Here, the light source is located at the maximum height of the parabolic arc.

An image from 3/4 of the way through the video. Here, the light source is located halfway between the maximum height and the ending point of the parabolic arc.

The last image in the video. Here, the light source is located at the ending point of the parabolic arc (behind the camera).

cse5280_raytracing's People

Contributors

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