开发者

Metal shading (like silver) on iphone opengl?

Does anyone know a tutorial hat e开发者_JS百科xplains 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


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".


Try something like this, transliterated to ES.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜