Usage: minray scenefile [--debug]
This program ray traces the provided scene and draws it using OpenGL. During tracing, the following interface is shown:
Scene content:
Shapes | 4
Point Lights | 1
Area Lights | 1
Scene settings:
Height | 800
Width | 800
Max Recursion | 10
Antialiasing | ON
Ray tracing progress
====================
If the --debug flag
is used, the following settings are used instead:
Scene content:
Shapes | 4
Point Lights | 1
Area Lights | 1
Scene settings:
Height | 400
Width | 400
Max Recursion | 5
Antialiasing | OFF
Ray tracing progress
====================
The scenefiles read by this program are slightly different than the one shown in the assignment. The following is a short, valid scenefile:
# Last Run
#
# Scene content:
# Shapes | 4
# Point Lights | 1
# Area Lights | 1
# Scene settings:
# Height | 800
# Width | 800
# Max Recursion | 10
# Antialiasing | ON
# Ray tracing progress
# ====================
# ====================
# Elapsed time [mm:ss] - 03:52
#
# Ambient light must be first instruction
amb: .3 .3 .3
# Spheres have position, radius, and material
sphere
pos: -1 0.5 -0.5
rad: 0.75
mat: .3 .3 .3 .5 .5 .5 20 0.9
# material is Diffuse, Specular, Phong exponent, and Reflection index
# Triangles have a texture (filename or null) and three vertices.
# Each vertex has position, normal, material (as above), and uv
# coordinates
triangle
tex: scenes/checker.bmp
pos: -10 -2 10
nor: 0 1 0
mat: 0.60648 0.22648 0 0.628281 0.555802 0.366065 50 0.6
uv: 0 0
pos: -10 -2 -10
nor: 0 1 0
mat: 0.60648 0.22648 0 0.628281 0.555802 0.366065 50 0.6
uv: 0 1
pos: 10 -2 -10
nor: 0 1 0
mat: 0.60648 0.22648 0 0.628281 0.555802 0.366065 50 0.6
uv: 1 1
# Point lights and area lights are the same as described in the
# assignment
point-light
pos: 1 1 3
col: 0.8 0.8 0.8
area-light
pos: 0.125 2.0 0
pos: 0.125 2.0 -0.125
pos: -0.125 2.0 -0.125
pos: -0.125 2.0 0
col: 1.0 1.0 1.0
Some example scene files are in the scenes/ directory.
- Triangle intersection
- Sphere intersection
- Triangle texture mapping
- Sphere & triangle Phong shading
- Antialiasing (4X supersampling)
- Recursive reflection (10 recursion limit)
- Test scene (images/final/redSpheres.png or blueSpheres.png)
- Shadow rays - I showed this at the presentation.
- Soft shadow for area light source - This is new. The updated final images in images/final/ have area lights, so this should be easy to verify.
- Non-naive (O(n^2)) collision detection
- Texture instancing
- Movable camera
- "Preview" mode
- Break dependency on Windows-format bitmaps
// This file
README.md
// Solution file
minray.sln
// Source directory
CS535Program5/
// main routine
main.cpp
// Raytracing and drawing routines
Scene.cpp
Scene.h
// Read scene file and load objects
SceneLoader.cpp
SceneLoader.h
// Scene objects
Ray.h
Shape.h
Sphere.h
Triangle.h
// Lights
AreaLight.h
PointLight.h
// Loads Windows format 24bit BGR bitmaps
Bitmap.cpp
Bitmap.h
// Useful constants, enums, and functions
Globals.h
// Scene description files and textures
scenes/
blueSpheres.txt
checker.bmp
planet.bmp
redSpheres.txt
test.txt
// Screenshots
images/
// Test scene and two scenes I made
final/
blueSpheres.png
redSpheres.png
test.png
// Images showing progression from just having
// Phong shading to reflections to shadow rays
// to soft shadows.
progress/
progress1.png
progress2.png
progress3.png
progress4.png
progress5.png
progress6.png
progress7.png
progress8.png
progress9.png
// Visual Studio files
CS535Program5.vcxproj
CS535Program5.vcxproj.filters
CS535Program5.vcxproj.user
// Vector math library
glm/
(There's a lot of files here)
- GLM OpenGL Math Library
- Information about Triangle intersection and Barycentric Coordinates
Christopher D. Parks, chris.parks@uky.edu