- Compiling x264 on Windows with MSVC
- C/C++ Snippets
- Reading Chunks from a Buffer
- Handy Bash Commands
- Building a zero copy parser
- Kalman Filter
- Saving pixel data using libpng
- Compile Apache, PHP and MySQL on Mac 10.10
- Fast Pixel Transfers with Pixel Buffer Objects
- High Resolution Timer function in C/C++
- Rendering text with Pango, Cairo and Freetype
- Fast OpenGL blur shader
- Spherical Environment Mapping with OpenGL
- Using OpenSSL with memory BIOs
- Attributeless Vertex Shader with OpenGL
- Circular Image Selector
- Decoding H264 and YUV420P playback
- Fast Fourier Transform
- OpenGL Rim Shader
- Rendering The Depth Buffer
- Delaunay Triangulation
- RapidXML
- Git Snippets
- Cross Platform OpenGL
- Basic Shading With OpenGL
- Open Source Libraries For Creative Coding
- Bouncing particle effect
- OpenGL Instanced Rendering
- A Collection Of Interesting Articles
- Mapping a texture on a disc
- Download HTML page using CURL
- Height Field Simulation on GPU
- Scholar
- OpenCV
- openGL
- Math
- Gists to remember
- Reverse SSH
- Working Set
- Consumer + Producer model with libuv
- Parsing binary data
- C++ file operation snippets
- Importance of blur with image gradients
- Real-time oil painting with openGL
- Basic CUDA example
- x264 encoder
- Generative helix with openGL
- Mini test with vector field
- Protractor gesture recognizer
- Hair simulation
- Some glitch screenshots
- Working on video installation
- Generative meshes
- Converting video/audio using avconv
- Auto start terminal app on mac
- Export blender object to simple file format
Spherical Environment Mapping with OpenGL
ARTICLE NOT FINISHED
Recently I found this great tutorial on spherical environment mapping which is an easy solution to add some detailed lighting to a visualisation. The great thing about this technique, is that you can use a simple 2D texture to define how the lighting and reflection of you model looks. This gives you an extremelly easy tool for fine tuning the appearence of your objects.
I'm going to describe my implementation here, which is basically the same as the above linked one; this is just one for my reference. Another great and more indepth article on how this technique works is described in this description from 1999 by Paul Zimmons.
Describing the environment
There are a couple of common techniques that are used with environment mapping. You have spherical, cubic and parabolic environment mappings all with their own pros and cons. Spherical mapping has the great advantage that is just uses one texture and it's cheap to perform the necessary calculations.
Below you can see how these spherical environment images, also called matcaps, look like. When you google for matcap, lit sphere, light probe you'll find a lot of these images. That's how I found the image below ... not knowing who the owner is (sorry)...

You can think of this image as a description of how your object will be shaded. From below it will have red/dark color shades and from the top it will be bright. When rendering an arbitrary object I created with blender (with normal mapping) you get something like this:

Shaders
In your vertex shader we will be calculating the texture coordinate that we need to use with our matcap texture. The mapping between the texture coordinate and matcap is described in geat detail in the article of Paul Zimmons.