Archived

This topic is now archived and is closed to further replies.

biovenger

Smooth rendering?

Recommended Posts

Is there an OGL method to smoothen out meshes as they are drawn? Right now I am loading all objects from .obj files or from my own binary file format .b3d. When I load an object, it gets choppy edges. I mean, they are whole, but they aren''t smooth at all. Is there a way to (non-software) antialias or smooth the objects pre-rendering (perhaps in a display list) or is there a setting in GL that smoothes out rendering. Or perhaps, is this a 3d modeler issue? All the objects I''ve tried are -very- low poly. But I think the issue is with OGL. I don''t have that large knowledge of OGL so please be throughout with your replies.

Share this post


Link to post
Share on other sites
You can smooth the model before you convert it to your file format or you write your own algorithm which smooth the model when loading you b3d file or smooth it on the fly. But I recommend you to save your model in a quite high resolution and simplify it on the fly.

--------------------------------------------------------

"If it looks good, it is good computer graphics"
"If it looks like computer graphics, it is bad computer graphics"

Corrail
corrail@gmx.at
ICQ#59184081

Share this post


Link to post
Share on other sites
I think want you want is smooth (Gourand) shading instead of flat shading. What you''ll want to do is for each vertex, calculate the average of all the normals of the surfaces in which it participates . When you render the scene, pass the vertex normal for each vertex instead of the surface normal. OGL will linearly interpolate the normals, and it''ll look much smoother.

Hope this helps.

Share this post


Link to post
Share on other sites
Thanks, it sounds logical, but I''m not sure if it will work.

As it is now, the models are loaded from an OBJ file which contains a vertex normal for each vertex. (Meaning, each face has three vertices and three normals)

These normals are drawn with each vertex and the shading itself is very smooth, gradient almost, pulling out as the light becomes more distant. The problem is the appearance of the lines (edges) of an object onto itself. It looks almost as if there are artifacts, but upon closer inspection it is just the edge lines that aren''t interpolated.

Share this post


Link to post
Share on other sites