You are currently browsing the category archive for the ‘Uncategorized’ category.

Introduction

For my CS 488 final project, I improved upon the ray tracer I built for a previous assignment to include advanced effects and optimizations. I started with the goal to build a renderer that can imitate the art style of the artist k3, who specializes in colorful and fun 3D renderings.

Objectives

1. Reflection

01_reflection

Reflection on objects

2. Transparency + refraction

02_refraction

Rows of glass spheres and blocks demonstrating refraction

3. Caustics

Caustics were not implemented due to lack of time.

4. Soft shadows

The following three images show the same scene rendered with 3 different lights:

04_soft_shadow_0

No soft shadow

04_soft_shadow_1

Soft shadow with area lighting size 1, 8 samples.

04_soft_shadow_2

Soft shadow with area lighting size 2, 32 samples.

5.  Texture mapping

05_texture

Texture mapping of cubes and spheres.

6. Constructive solid geometry

06_csg

Constructive solid geometry was implemented, supporting union, intersection, and subtraction of cube, sphere, cylinder, and cone primitives.

7. Additional primitives: cylinder and cone

07_primitives

Rows of cylinders and cones.

8. Normal interpolation for Phong shading

Not completed due to lack of time.

9. Uniform spatial partitioning for meshes

Uniform spatial partitioning can be enabled for each individual mesh object. The following scene (from A4) contains 3 cow models, each with 5804 polygons. 09_uniform_spatial_subdivision

This scene was rendered with increasing number of partitions to compare render time. All renders done with bounding box optimization, 8 threads and no supersampling.

ussd_times

This graph shows rendering and total time as the number of partitions increases. Total time = render time + preprocessing time. We can see that partitioning the model into 2x2x2 partitions had huge benefits, but there is diminishing returns after that, and eventually the increase in processing time outweighs the improvement in rendering time.

10. Final scene

This is my final scene. Inspired by artworks by k3. 10_final_scene_small

The following is the same scene rendered at a larger size. Unfortunately, this rendering didn’t finish until past the submission deadline.

10_final_scene_2

Extra Objectives

Schlick’s approximation of Fresnel reflection

I implemented Schlick’s approximation of Fresnel refraction to make my glass objects look better. Here is a comparison:

02_refraction

Without Schlick’s approximation.

02_refraction_schlick

With Schlick’s approximation. Notice the reflection on surfaces when the view angle is shallow.

Parallel processing

Tracing of rays is split among a number of worker threads. Here are the rendering times for the reflection scene at 2x supersampling, on a Intel 4 core CPU with hyper-threading:

parallel processing render time

Rendering time with parallel processing.

Bounding box optimization for meshes

For meshes with large number of polygons, significant time savings can be achieved by first testing rays against the mesh’s bounding box. Rendering times for macho-cows.lua (8 threads, no supersampling):
Without bounding box optimization: 854 seconds (14.2 minutes)
With bounding box optimization: 27.161 seconds

I know it’s been a while since I last updated Tenshi, but university just started and I didn’t have as much free time as before. Anyways, I’ve put together a relatively major update for the Tenshi Pet. I added dual screen support that Michael requested, and some new features (see change log).
Also, I decided to just use mediafire for all my file hosting, since it’s more reliable and less hassle than free web hosts.

Download (1.2.1)
Mediafire: http://www.mediafire.com/file/hahfm6ans2rpmv7/tenshi-1.21.zip
Please read previous posts for the required fonts and .NET framework: https://fobcraft.wordpress.com/2010/07/08/pet-tenshi-update/

Change Log:
Ver 1.2.1:

– Added dual screen support
– Added “about” window
– Now if you drop the rock on Tenshi when she’s standing, she will grab it right away
– Added “Dismiss/Summon Tenshi” option
– Added right click menu on rock
– Added the ability to drag Tenshi (she will follow your mouse if you click on her and drag left or right)
– Added opacity options
– Fixed some problems with Tenshi getting stuck not doing anything