Thursday, August 9, 2012

OpenGL4.2 Triangle Tessellation

Original triangle mesh.
 Tessellation with gl_TessLevelOuter[0-2]=2, gl_TessLevelInner[0] = 1.
 Render result with one point light source and diffuse pass only. The above two meshes will give same results. A tessellated polygon will produce more polygons and the normal will not change.



Saturday, August 4, 2012

Procedural Textures - Noise


First, some of my results.
Sky shader using Perlin noise.
 I haven't got a name for the pattern yet. This time, Gauss noise is used instead of Perlin Noise.
Same pattern as above image but different color. I just want to know which color of teapot I'd like to buy if there are real ones. Hope you like it too.

Seamless noise texture is still a problem for me. I have tried simplex noise of GLM lib but still met edges on texture boundries.

Wednesday, August 1, 2012

Spherical Harmonics for Diffuse Objects Lighting

I found my ray tracer code is in a mess and redesigned it. I want to write an unbiased path tracer this time and it is not finished yet. 

For a relax, I turn to play with OpenGL and GLSL again. Anyway, it is a much easier way to implement graphics techniques with help of them.

Spherical harmonics approximation is similar with approximating a function in terms of Fourier series but the function is defined over sphere now. When reading about its history, you will meet great mathematicians such as  Pierre Simon de Laplace and Adrien-Marie Legendre again. It also reminds me of discrete cosine transform for image compression. Both the techniques only pick low frequency ( most significant ) parts of data. 

Here are some of my results,

Diffuse teapot lighting by Uffizi Gallery Probe.

 Diffuse*0.8+Mirror Reflectance*0.2 lighting by Uffizi Gallery Probe.

 Diffuse teapot lighting by Grace Cathedral Probe.

  Another diffuse teapot lighting by Grace Cathedral Probe.

References


An Efficient Representation for Irradiance Environment Maps,Siggraph 01, pages 497-500, 
project site:

http://www.cs.berkeley.edu/~ravir/papers/envmap/

A good reading about Spherical Harmonics is at Appendix B of
http://zurich.disneyresearch.com/~wjarosz/publications/dissertation/

and The Orange Book.