Skip to content

1180779/SpheresRaycasting

Repository files navigation

Simple Spheres Raycasting

Simple Spheres raycasting in CUDA (rendered with openGL).

Parameters

Some parameters are avaliable to configure before starting the raycasting. They include

  • the number of spheres
  • x, y, z (for location) and radius values ranges
  • spheres material (choice from predefined list)
  • number of sources of lights
  • location and radius ranges for light sources
  • Phong reflection model parameters for lights (ranges)
  • camera resolution (which determins the number of cast rays)

Parameters can be loaded from file within the executable location (check example config in repo)

After the start of casting

After the start of casting user has fewer options at their disposal.

  • Ambient component of Phong reflection model can be changed (value 0 - 1)

  • Animation mode can be set to rotate the lights around the center of the scene with time.

  • User can select to rotate the light sources or the spheres around the center of the scene.

  • Camera movement is not possible.

  • Rays are cast from the camera position along the Z axis and intersection with spheres in the scene are checked. After failing to implement LVBH myself (to be fair I didn't try particulary hard) I have used this github project.
  • Based on ray intersection with spheres Phong reflection model parameters and the pixel color are calculated
  • Color is written to openGL texture
  • Texture is render on the screen by openGL

Examples

  • matte material

  • glossy material

  • soft material

Some sources

Dependencies

The project uses

Build

Build in Visual Studio 2022 with CUDA support. Installation steps can be found here.

Dependencies are placed in the Libraries subdirectory or are directly part of source files.

About

Raycasting of spheres

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages