简体   繁体   中英

OpenGL ES 2.0 vertex lighting

I'm trying to obtain a smooth lighting effect on a solid with openGLES 2.0. I exported an .obj solid from blender and converted the obj file in C array of vertex and normal (with obj2openGL - http://heikobehrens.net/2009/08/27/obj2opengl/ ).Then I draw this data on my openGL ES app on iPhone. The problem is that the faces of the solid have a flat lighting (the same color for each face). I want a smooth effect without using per fragment lighting. I tried to increase the number of faces but with no results.

Is there a function on openGLES2.0 that control this effect (smooth vs flat lighting)?

I solved the problem. In order to export vertex normal in a .obj with blender 2.62 must be selected "shade smooth" (while in edit mode ctrl-F and choose shade mode). Hope this can help someone!. Thanks very much Christian, it was the easiest solution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM