Thursday, November 22, 2012

Snow Shading Kick Off

Finally, I choose to do snow shading for my final project. I like snow, it will be interesting to construct a snow white world. There are two parts in this project: snow accumulation and snow fall. After some research, I started to get some ideas for snow shading.

Snow Accumulation
Snows distribution differs for different terrains. This is determined by the height and gradient.  I need to calculate the coverage of snow of terrains: terrains may be exposed to the snow or not, heights of accumulated snow also varies. How to calculate exposure? We could transform models into ortho view from the point of sky. And then use the depth to determine whether points are occluded. For the accumulation heights, use the normals to get them. While rendering the snow, we also need some noise to make snow Glisten.

Snow Fall
http://oos.moxiecode.com/js_webgl/snowfall/
This is the result I want.
First I need a function to generate snow in a 2D plane and  give snow a random depth. Then determine the size and  blur effects due to its depth. Maybe I could also design different shapes for snow.

Hope my final project goes well!!

Reference:
http://http.download.nvidia.com/developer/SDK/Individual_Samples/DEMOS/Direct3D9/src/SnowAccumulation/Docs/SnowAccumulation.pdf
http://jimbomania.com/software/snowfall.html
http://171.67.77.70/courses/cs448-01-spring/papers/fearing.pdf

Wednesday, November 21, 2012

GLSL2

Here are some results from this project.

Feature implemented:
  • Bump mapped terrain
  • Rim lighting to simulate atmosphere
  • Nighttime lights on the dark side of the globe
  • Specular mapping
  • Moving clouds
  • water animation
  • Space Screen Ambient Occlusion
  • Vertex Morphing(Morphing between a sphere and the cow)(Press M/m button, N/n for pass shader)
  • Vertex Pulsing(Press P/p button, N/n for pass shader)



Something is not normal about the vertex pulsing, although I move vertices along normals. I believe the reason is that a single vertex have many normals in the buffer, so when I move vertices, it have many directions. As a result, the cow becomes explosive.


12 * 12 Gird



4 * 4 Grid

Friday, November 9, 2012

GLSL Programming


filters:
* Image negative (3)
* Gaussian blur  (4)
* Grayscale      (5)
* Edge Detection (6)
* Toon shading   (7)
* Pixelate       (8)
* Contrast       (9)
* Swirl          (0)

Vertex Shader:

* A sin-wave based vertex shader:
* A simplex noise based vertex shader:
* Hat like vertex shader

Wednesday, November 7, 2012

Raterization_2

I fixed one problem, I wrongly derived the inverse matrix of eye perspective matrix. Looks much more normal now.

Add another mouse movement.
Alt + Middle for translation.



Tuesday, November 6, 2012

Rasterization


Graphics Pipeline stages included. 
1. Vertex Shading
2.  Primitives Assembly
3. Perspective Transformation
4. Scanline Raterization
5. Fragment Shading
6. Depth Buffer
7. Lambert Shading
8. Scissor Test
9. Blending

Finally, the Maya Style interactive camera.

Alt + Left Click to rotate the camera. 
Alt + Middle to translate the camera.
Press s for scissor test effects. after press s then click drag mouse to select scissor area.  
Press b for blending effects.  




-