views:

83

answers:

2

Hello

Does anyone know a tutorial hat explains how to shade an object to look like silver metal? (on iphone)? Maybe starting with a spere like in this: http://iphonedevelopment.blogspot.com/2009/05/opengl-es-from-ground-up-part-5-living.html

Or can this not be accomplished without the new shaders in 2.0?

Thanks Sebastian

A: 

Try something like this, transliterated to ES.

genpfault
A: 

What you look for is called environment mapping. This can be done using sphere mapping (this can be done on very simple hardware) or cube mapping.

Cube mapping could be done long before pixel shaders became popular, but it seems they are an extension to OpenGL ES 1.1, so the iPhone may or may not implement it (quick googling suggests not, but I didn't try).

Sphere mapping should be supported in ES. It has been in OpenGL since the beginning, I believe.

Anyway, to clarify: These methods only transform texture coordinates, so they need not work on pixel level. Hence a pixel shader is unnecessary. However, using a pixel shader you could do more advanced stuff like bump mapping, which would give your object more of a "surface".

Krumelur
Cube Mapping looks like what i want. now trying to get NeHE Lesson23 to run on iPhone ;-)
Sebastian