I just finished creating a graphics demo for a chapter I’m writing for the book iPhone Advanced Projects edited by Dave Mark. In the chapter I go over a few different lighting techniques and go in detail on how to do masked environment mapping on an iPhone 3G with OpenGL ES 1.1.
The demo ended up looking pretty good, so I decided to upload a quick video showing the different lighting modes:
- Diffuse texture only
- Diffuse texture plus ambient and diffuse lighting
- Diffuse texture plus ambient, diffuse, and specular lighting (as usually, per-vertex lighting looks pretty bad, even though this is a relatively high-poly model)
- Fully reflective environment map (using the normal environment map technique)
- Environment map added to the diffuse texture and lighting
- Environment map with a reflection mask plus diffuse texture and lighting (two passes on an iPhone 3G–or one pass if you’re not using the diffuse alpha channel)
The chapter in the book will go in detail into each of those techniques, building up to the last one. Full source code will be included as well.
Some of these techniques will also be covered in my upcoming Two Day iPhone OpenGL Class organized in collaboration with Mobile Orchard.