Coder Social home page Coder Social logo

simple-raytracing's Introduction

Simple Ray Tracing

By Ilia Shevchenko

Overview

This ray tracing application is a simple implementation that progressively evolves through various stages to achieve realistic rendering of 3D scenes. The program demonstrates key concepts in computer graphics, including intersection calculations, material properties, lighting, shadows, and recursive ray tracing.

Getting Started

To compile and run the application, use the following commands:

make clean run

To test the application, execute:

make clean test

Evolution of the Program

0) Gradient Testing

The initial stage involves testing the basic functionality of the Image class with gradient patterns.

Gradient

1) Sphere Intersection Implementation

The program introduces the first implementation of sphere intersections to handle basic geometric shapes.

Sphere Intersection

2) Sphere Material Implementation

Materials for spheres are implemented to simulate surface properties, adding realism to the rendered scenes.

Sphere Materials

3) Diffuse Lighting

The application incorporates diffuse lighting to simulate how surfaces interact with light, providing a more realistic appearance.

Diffuse Lighting

4) Intensity Clamping

To avoid unrealistic brightness, intensity clamping is introduced, ensuring that light intensities are within a reasonable range.

Intensity Clamping

5) Specular Lighting (Phong Reflection Model)

Specular lighting is implemented using the Phong reflection model, enhancing the visual quality of reflective surfaces.

Specular Lighting

6) Shadows and Ambient Lighting

The program adds shadows, ambient lighting, and correct reflection from the nearest object, improving scene realism.

Shadows and Ambient Lighting

7) Recursive Ray Tracing

Recursive ray tracing is implemented to simulate reflections, refractions, and more complex lighting effects.

Recursive Ray Tracing

8) Additional Objects - Plane Class

The Plane and virtual Object class implemented, expanding the variety of objects that can be rendered in the scene.(Previous Object class renamed to Sphere)

Plane Class

9) Additional Objects - Anti-Aliasing

The final evolution introduces anti-aliasing - rendering the scene multiple times to get smoother image.

Plane Class

simple-raytracing's People

Contributors

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