PDA

View Full Version : GPL code for per-pixel phong and ambient occlusion



Thanassis Tsiodras
03-20-2009, 07:19 AM
I finished coding a Phong and ambient occlusion renderer of .PLY files that are generated from the open source shadevis.
You can see screenshots and download the (very) portable code - or pre-built Win32 binaries - from my site, at:
http://ttsiodras.googlepages.com/trimesh.html.

The vertex/fragment shaders I use perform both Phong shading and interpolation of the ambient occlusion factor (which is calculated by shadevis per vertex).

Enjoy!

P.S. the "pure" OpenGL mode (no shaders) uses glMaterialfv to pass the ambient occlusion factor per triangle, and is unfortunately... more than two times slower than the fragment shader version. Any advice on ways to improve this will be most welcome.

Thanassis Tsiodras, Dr.-Ing.
ttsiodras_at_the-well-known_gmail-dot-com