Wednesday, February 25, 2009

Final Team Report

Title: “The Fractal Valley”

Team:
Matthew Kang – Leader
Minh Thu Tran
Computer Graphics II- 4003-571
Instructor's name: Reynold Bailey
Project Web Site : http://trankangcg2project.blogspot.com

Introduction:

The project will generate a high-polygon scene involving a mountainous region that surrounds a lake. The valley will be created with a fractal algorithm to create a realistic terrain environment. The lake will be created with various liquid volume techniques in order to effectively simulate a body of water. A “free-look” camera will also be implemented.

Project Objectives

o Generating fractal terrain to create a mountain
o Create a water material that looks and (to a degree) behaves like water
o Relatively high polygon count

Image pipeline:

This project, we put emphasis on 3D modeling as well as texture aspect of image synthesis pipeline. We re-implemented the fractal algorithm with perlin noise that was taught in class. We also implemented bump mapping in our water texture map that was also mentioned briefly in class.

Approach:

We generated the mountain range and then put the animated plane of water at the depth that is pre-defined as the threshold for water. The image looks as it sliced horizontally half-way given the lake effect in the middle of the mountain when look from top down or at an angle of top down, but from a view above the valley, its looks as intended.

Technical:

Fractal: We used the diamond square to generate the mountain range. This entails populating the heightmap with averages of surrounding heights, generating enclosed diamonds and squares until the heightmap is fully populated. The heightmap is a SxS array, where S must equal (2^i)+1. Every averaged height value was summed with a perlin noise function to create a cohesive, interpolated random landscape of heights. A texture map is also generated based on the height map, creating gradient of color based on a range of heights, thus creating snowy peaks and shades of green for the hills.
For water:
Use OpenGL as the basic foundation. Using environment texture map, which basically compute the color of a texture at a point, then pass it to another texture compute it, it keep the cycle on an on, until we generated all textures. The result color of a point = (normalized_vector_from_surface_to_light ∙ normal_of_surface) * material_textures.
Instead of using black & white bumpmap, I used normal map image as a bumpmap which gives the variation in the normal of the plane which give it the “bumpy” effect that we desire. We have 60 normal map images as bump maps and 60 images for the base maps. These will be swapped constantly with a delay to give it a smooth animation of water. Though, we have extended the glMultiTexCoord() to implement up to 32 textures, when we integrate it into the fractal, it slows down the system tremendously due to the amount of memory that it take. Thus it is throttled to 10.

Results:
The following images are our final results:


Future Enhancements:
We like to implement the following as a future features to our current project:

o Generate fractal trees on the terrain

o Generate fractal sky (cloud)

o Implement Navier-Stroke fluid dynamic technique instead of bump mapping, and instead of the plane slicing the fractal, we like to get the water feature totally engulfed within the fractal, so that the user would perceived as a 1 piece feature.

o Implement translucent & caustic effects to the water features.

o Fix: there is a dark region that’s surrounded by the water that’s due to the light effect of the bump map that we like to enhance on, and may give it water splash.

Appendix A:

Platform: Window XP
API: OpenGL
Language: C++
Software: VC++ 2008

How to run: Go to the follow directory: fractal valley > Release, click on fractal valley.exe the program should run. If the program does not run, do the following. Go back out to fractal valley directory, open the fractal valley.sln, go to Debug menu, select “Start Debugging”. This will run the program. If the program says that it could not find glut.h, please put all the glut files inside the include files of VC++ include and its libraries in the VC++ lib directories, or append GL/ to all includes that use (in other words, use instead of . The program will run. After completing the above step and you still have a problem, please contact either Matthew or I, we will figure out why.

Once in the program, you may navigate using the ‘w’ and ‘s’ to move forwards and backwards respectively, and ‘a’ and ‘d’ to look left and right. ‘r’ and ‘f’ will look up and down. ’q’ will quit the program.

Appendix B:

The following C++ code files should be found in fractal valley code submission:

o all.h

o Color.h

o def.h

o Extensions.h

o fractal.h

o fv.h

o matrix.h

o matrix_ops.h

o perlin.h

o Texture.h

o Extensions.cpp

o fractal.cpp

o fv.cpp

o perlin.cpp

o Texture.cpp

Acknowledgements:
We borrowed the matrix.h, matrix_ops.h from Neon Helium tutorial. The setting up of glMultiTexCoord() base on Paulsprojects.net. Perlin.h and perlin.cpp are libraries from flipcode.com by John Ratcliff.

final result


Tuesday, February 17, 2009

Renderman Assignment - Matthew Kang

Modified Image
New Image and Contest Image




water bumpmap


finally I got it to work - using normal map to bumpmap it instead of black & white, the bumpmap is bluish

Thursday, February 12, 2009

Ckpt7- Reinhard & Ward Tone Reproduction


Reinhard Lmax =1


Ward Lmax=1

Reinhard Lmax=1000


Ward Lmax = 1000


Reinhard Lmax = 10000


Ward Lmax = 10000

Extras:

Reinhard Constant value key = 100


Reinhard key at a pixel value, pixel(x,y) = pixel(300,1)

Friday, February 6, 2009

Checkpoint 6



Checkpoint 6, with all preset k-values.

Monday, February 2, 2009

Water - bumpmap




Bumpmap - using different bumpmap and texture.. none of them generate a desirable effect for the water .. perhap I need a better bumpmap or noise is a better method to create water-like surface than bumpmap!


Monday, January 26, 2009

Checkpoint 5 - Reflection


kr = .5


Kr = 1.0



kr = 1.0
All the image is with max_depth of 5.

-MT

Thursday, January 22, 2009

Shader Assignment -- By Minh Thu Tran

Default Image:



Modified Image:

3 diff shaders:
I applied surface shader and displacement shader on the spheres.
Extra images:


I used 4 open sources shaders by various author.




This is my contest image, same shaders as about, just different color and frequencies

Water Simulation..




Here is the image the I got using texture map the water on the plane, then use the sin function to variate the amplitude of the water to give the height and depth. Though, I need to find a better water image for this and a different algorithm that convert .bmp files into RGB files.

Next step would be trying to get the bump map to work.

-MT

Monday, January 19, 2009

Mid-Quarter update

Title: “The Fractal Valley”
Team:
Matthew Kang - Leader
Minh Thu Tran
Computer Graphics II- 4003-571
Instructor's name: Reynold Bailey
Project Web Site : http://trankangcg2project.blogspot.com
The project will generate a high-polygon scene involving a mountainous region that surrounds a lake. The valley will be created with a fractal algorithm to create a realistic terrain environment. Time permitting; trees will also be generating using fractals. The lake will be created with various liquid volume techniques in order to effectively simulate a body of water. A “free-look” camera will also be implemented.
Project Objectives
Generating fractal terrain to create a mountain
Create a water material that looks and (to a degree) behaves like water
Relatively high polygon count
Platform: Window XPAPI: OpenGLLanguage: C++
A breakdown of project components, e.g.:
Fractal Generator: An abstract fractal generator that takes an expression and draws polygons based on them.
Water volume: A conglomerate of algorithms to simulate water.
Main Program/Keypress: Plug in fractal algorithm, parameters, draw basic water volume, and camera free-look keypress events.
Project Responsibilities: Minh Thu Tran – design and research (water volumes), implementation, texture map Matthew Kang – design and research (fractal terrain), implementation, texture map.
Project Timeline: Over the break – Research and partially implement general algorithms mid-Quarter – Create a texture-mapped proof-of-concept 8/9th week – Have the scene fully created
10th week – Add extra functionality (trees, lighting effects) 11th week – Practice project demonstration
Status: We currently are still in the research phase, with early implementations down, but not fully functionally as of yet. An abstract fractal algorithm generator is underway, but it still needs more work before it is off the ground.
Assessment of Progress: Our timeline is slightly changed, as we have decided to “cut the fat” and focus solely on fractal terrain generation and bump mapping for the water instead of using Navier-Stroke fluid dynamic. This will give us ample time to get the final scene fully working and satisfactory to our personal expectations.
Revised Timeline:
Over the break – Research and partially implement general algorithms mid-Quarter – partially implement general algorithms 8/9th week – Have the scene fully created
10th week – Revising scene generation and techniques & present on the last day

Tuesday, January 13, 2009

CheckPoint 4- Procedural Shading



Checker Board Floor.
Extra- another procedural shading...
-MT

Friday, January 9, 2009

Attemp to fix our Phong Model



These are some of the images that I got while trying to figure out why my Phong Model doesn't work ... After I successfully fix the back lit problem .. I ran into problem that the diffuse and the spec are totally backward. I'm totally clueless.

Wednesday, January 7, 2009

Checkpoint 3 - Basic Shading using Phong Shading Model

One light Source- the color of the floor changed from green to red because
I'm in the middle of working on the procedural shading for the plane.
It was not complete at the time I render these images. This image used Phong Illumination Model.
3 light sources -- you can see 3 different specs clearly on the blue orbs. Still use the Phong Model.

Phong-Blinn Model -It turn out that the halfway vector is much easy to calculate that the reflectant vector. You does see the different in the spec clearly. This image is render with only one light source.
Problem solves! Morals: 1- Don't normalized camera position before calculation. 2 - Check to make sure the angle between light and the surface normal are between 0 -1. 3- Never calculated the intersect of the shadow ray on the primitive of the POI itself.


One light source using basic Phong Shading Algorithm. -

- When there is only one object in the scence, the shading work correctly, but when there is more than one object in the scene, take into account the hidden surfaces and calculated the color of those. I check my vector calculation, it calculated correct, Sphere and Plane Intersect function does return the correct t (least positive root). But I don't know why/what cause the effects.



This is 3 different light sources .. you can see 3 shades with light and dark and color in the shadow because of the color of the light.


This is one light source using PhongBlinn model. You can see the specular on the sphere much clear and nicer.. (even though the position is wrong)..
Here is the partial result that illustrate the problem:
Individual sphere: Each sphere shaded correctly individually.



When I put the two sphere together, the light some how lit the hidden surface instead. I check the logics and vector calculation, everything return correctly.
-MT