Smooth rendering?

Started by
2 comments, last by biovenger 20 years, 8 months ago
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.
-----------------------------Final Frontier Trader
Advertisement
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
--------------------------------------------------------There is a theory which states that if ever anybody discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.There is another theory which states that this has already happened...
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.
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.
-----------------------------Final Frontier Trader

This topic is closed to new replies.

Advertisement