opengl - Cylinder Normals -
i'm developing opengl application right draws big tube consisting of several small cylinders (kind of slinky). i'm getting annoying effect when turn lighting , normals on, angles these annoying black dots on cylinders' borders:
i belive byproduct of fact cylinders thin. set normal (0,0,+/- 1) when setting top/base, , side normals (cos(toradian(beta)), sin(toradian(beta)), 0).
is possible remove effect whitout getting 'fatter' cylinders? or there wrong in way define normals?
thanks
this appears rendering of sides of cylinders. yellow in image corresponds tops of cylinders. sides of cylinders @ 90 degrees tops, not lit (i'm guessing light in same direction camera) , appear black. cylinders being thin these not fill make pixels don't show much.
how fix it? i've got couple of ideas:
1) draw tops , bottoms, not sides - fix problem when viewed angle, lead further problems if camera moves.
2) disable lighting, faces drawn same colour (assuming sides same colour top).
3) use multi-sampling - means of edges won't appear (as each pixel more top side due angle).
4) add more lights around scene, perpendicular current light.
1 & 2 best bet depending on you're trying achieve.
Comments
Post a Comment