Skip to content

Raytracing project in Unity for computer graphics graduate credit.

License

Notifications You must be signed in to change notification settings

SIZMW/unity-raytracer

Repository files navigation

Unity Raytracer

Description

This project is used to demonstrate additional components of raytracing within Unity for our graphics course (CS 4731).

Features

  • The mirrored surface on the sphere was done using the ray tracer implementation and recursively calculation the colors bouncing off other objects. From the first ray collision, the reflection was calculated and the ray tracing was run again from the new reflection ray.
  • The texture mapping on the cube was done using bilinear pixel interpolation. For every texture coordinate that was hit by a ray, the coordinates were interpolated across the texture map. The coordinates were scaled and averaged between pixel coordinates on the texture.
  • The light attenutation in the entire scene was done using the quadratic term in the attenuation function. The function was based on the distance from the light to the hit point in question during the calculation.

Notes

  • This project demonstrates ray tracing in Unity, which is a real time rendering engine. The project is setup such that the image is rendered from left to right, top to bottom.
  • Each pixel on the image plane is given the appropriate color after light, reflection and texture calculation.

Resources

Building

This project can be built within Unity.

Usage

Open this project in Unity and run in order to allow the ray tracing render the scene.

Source Files

  • RenderLoop.cs
    • This is where the raytracing functions are implemented.
  • RaytracedCamera.cs

Screenshots

  • mirror
    • This is a screenshot of just the mirror effect on the sphere.
  • attenuation
    • This is a screenshot of the mirror effect and light attenuation on the entire scene.
  • texture
    • This is a screenshot of the mirror effect, light attenuation and the texture mapping on the cube.
  • final-scene
    • This is a final screenshot of all the effects listed above in one scene.
    • This is where the camera and rendering plane are setup for this project.

About

Raytracing project in Unity for computer graphics graduate credit.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages