Use triangle normals in OpenGL to get vertex normals -
i have list of vertices , arrangement triangles per-triangle normalized normal vectors.
ideally, i'd little work possible in somehow converting (triangle,normal) pairs (vertex,vertex_normal) pairs can stick vao. there way opengl deal face normals directly? or have keep track of each face given vertex involved in (which more or less happens when calculate index buffers) , manually calculate averaged normal @ vertex?
also, there way skip per-vertex normal calculation altogether , find way inform fragment shader of face-normal directly?
edit: i'm using should portable es devices fixed-function stuff unusable
i can't speak latest full-fat opengl specifications in es you're going have work yourself.
although normal modal under old fixed pipeline else, attached each vertex. if opted flat shading model gl use colour @ first vertex on face across entire thing rather interpolating it. there's no way recreate behaviour under es.
attributes per vertex , uniforms — @ best — per batch. in es there's no way specify per-triangle properties , there's no stage of rendering pipeline have overview of geometry when distribute them each vertex individually. each vertex processed separately, varyings interpolation , each fragment processed separately.
Comments
Post a Comment