Thursday, January 27, 2011

Ray Tracer Part Six: Transmission (refraction)

Now that we have reflection in our scene, we can go ahead and add refraction. The computation for refractions is based on snell’s law and is a bit more complex than reflections, but nonetheless, since we already have our raytracer setup to spawn additional rays, it’s not too difficult to add support. Below is our scene with transmission enabled to make a glass-like sphere:

Refractive

Ray Tracer Part Five: Reflectivity (and recursive tracing)

The next part of our raytracer involves adding in reflectivity to objects, which extends our raytracer to a recursive raytracer. This means that for each ray shot into our scene, we may end up tracing more to resolve reflections or (soon to be) transmissions (refractions) in our scene. Below shows the result of adding a reflective surface to our scene:

Reflective

Tuesday, January 18, 2011

Mid-Quarter Update

Project Title: Using particles to model fluid simulation
Name: Michael Culek
Course: Computer Graphics II (4003-571)
Professor: Reynold Bailey
Blog: http://mxc4873.blogspot.com/

Revised proposal Information:

Project Objectives
Model 3D fluid simulation using particle simulation.
Enhance performance by enabling the use of compute shaders.
Be able to apply outside forces and pressure to a system at any point in space.

 My goal is to implement the above tasks on my own by the end of the quarter.

 Revised Project Timeline
                Pre-week 6
                        Implemented basic fluid behavior.

                Week 6-7
                        Begin work on adding forces back into the system.
Implement a GUI model system for monitoring information and adding information to the world.

                            Week 8-9
                                    Optimize existing code to run better of lower end systems
Begin implementing other potential rendering methods (metaballs, marching cubes, etc)

                            Week 10
                                    Polish

Done so far
Thus far, I have managed to get fluids working with somewhat little success. The fluid simulator does obey basic incompressibility rules; however the variables and constants are far from perfect. A basic compute shader (though highly unoptimized) has been implemented.

Assessment
Thus far I have managed to come a long way. With basic fluid simulation already working, quite a bit has managed to get accomplished. Part of the reason for this rapid succession is due to the effort being put into my 2D class project which also involved fluids. My 2D projects, however, have not been modified to work in full 3D, which this project is capable of.

Wednesday, January 12, 2011

Ray Tracer Part Four: Procedural Shading

Since we have completed the basic shading stage of our raytracer, we are able to move on to more advanced concepts such as texture mapping. In this case, we are not using textures from files, but rather, procedurally generated textures, which we will map to our surface using calculated u,v coordinates.

imageimage

On the left, you can see the procedurally shaded floor using a procedural shader which generates a color in a tile-pattern. The calculation simply detects if the position is an even or odd row/column and returns the correct color. On the right, you can see a slightly more interesting shader which simply calculates the difference between the center point of a square area and returns a color based on the distance from it. If the point is outside of the circles radius, we color it yellow, otherwise, black.

Tuesday, January 4, 2011

Ray Tracer Part Three: Basic Shading

Once we finish detecting the objects correctly from part two, we can move on to shading. For this part, I have implemented a multi-light system with Phong and Phong-Blinn illumination models.

phong_single_lightphong_multi_lightphong-blinn

From left to right: Single-light with Phong shading, Multi-light with Phong shading, Multi-light with Phong-Blinn shading