Skip to content

JacksonHoggard/raydream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💡 RayDream: Java Ray Tracer

A simple yet powerful ray tracer implemented in Java. RayDream creates realistic images by simulating the behavior of light rays as they interact with objects in a scene.

example

Features

  • Ray Tracing Basics: Implements fundamental ray tracing algorithms, including object intersection, reflection, refraction, and shading.
  • Scene Description: Define scenes by programmatically constructing objects and lights.
  • Support for Basic Shapes: Supports rendering of basic geometric shapes such as spheres and boxes.
  • Model Support: Supports rendering of models in the wavefront obj format.
  • Materials and Textures: Assign materials and textures to objects to add realism to a scene.
  • Antialiasing: Reduces aliasing artifacts with built-in sampling techniques.
  • Parallel Rendering: Utilizes multi-threading for faster rendering of complex scenes.
  • Acceleration Structures: Makes use of bounding volume hierarchies and adaptive supersampling to reduce computation times.

Usage

RayDream is designed to be easy to use while still providing flexibility for advanced users. Here's a basic example of a scene in RayDream:

+ camera:
width: 1920
height: 1080
fov: 50
aperture: 20
from: -2 1 1
to: 0 0 -2
up: 0 1 0
;

+ ambient:
color: 1 1 1
brightness: 1
;

+ light: sphere
position: 10 10 10
color: 1 1 1
brightness: 10
radius: 2
;

+ object: sphere
transform:
| translation: 0 0 -2
| rotation: 0 0 0
| scale: 1 1 1
/
radius: 0.5
material: glass
| ambient: 0.1
| ior: 1.5
/
;

+ object: sphere
transform:
| translation: 0 0 -2
| rotation: 0 0 0
| scale: 1 1 1
/
radius: 0.45
material: glass
| ambient: 0.1
| ior: 0.6667
/
;

+ object: sphere
transform:
| translation: -0.5 0 -3
| rotation: 0 0 0
| scale: 1 1 1
/
radius: 0.5
material: reflective
| color: 1 0 0
| ambient: 0.1
| lambertian: 0.6
| specular: 0.6
| exponent: 50
| metalness: 0.2
| ior: 0.617
| k: 2.63
/
;

Contributions

Contributions to RayDream are welcome! Whether you want to fix bugs, add new features, or improve documentation, your contributions are greatly appreciated. Just fork the repository, make your changes, and submit a pull request.

License

This project is licensed under the MIT License.

Acknowledgments

Resources used for this project.

About

💡 Raytracer in Java

Resources

License

Stars

Watchers

Forks

Languages