PDA

View Full Version : can my scene be smoother than this?



mithun_daa
02-06-2004, 09:49 AM
i have generated a terrain using some elevation data. it looks OK when the viewpoint is far, when i zoom in, it looks a little jaggered. can i do any better than this? i have normals being generated at each vertex of the triangle in the terrain. i have a 1D texture that acts as a colorscale.
when 1D textures are used, are the colors applied per plane or per vertex?
thanx in advance

http://www.worldgeodata.com/images/img2.jpg

http://www.worldgeodata.com/images/img1.jpg

[This message has been edited by mithun_daa (edited 02-06-2004).]

M/\dm/\n
02-06-2004, 11:46 PM
Are you avaraging normals at each vertex? If you have 3 triangles connecting at vartex avarage their face normals.

zeckensack
02-07-2004, 06:44 AM
If you don't do this already, try "trilinear" filtering for your 1D texture (ie GL_LINEAR_MIPMAP_LINEAR, use glu to generate the mipmaps).

ZbuffeR
02-07-2004, 07:04 AM
I think Madman has it, you seem to specify normals for 'flat rendering'.
For each distinct vertex, you will have to average the normals of the *6* triangles that are adjacent. Do not forget to glEnable(GL_NORMALIZE).

mithun_daa
02-09-2004, 07:12 AM
Originally posted by ZbuffeR:
I think Madman has it, you seem to specify normals for 'flat rendering'.
For each distinct vertex, you will have to average the normals of the *6* triangles that are adjacent. Do not forget to glEnable(GL_NORMALIZE).


is it 6 triangles or 3. what would give me the best result. i guess 6
now herez an image, can anyone giv me n eg. sequence of triangles. this maybe too rudimentary, but im gettin confused

http://www.worldgeodata.com/images/triangles.jpg



[This message has been edited by mithun_daa (edited 02-09-2004).]

[This message has been edited by mithun_daa (edited 02-09-2004).]

mithun_daa
02-09-2004, 07:32 AM
Originally posted by mithun_daa:

is it 6 triangles or 3. what would give me the best result. i guess 6
now herez an image, can anyone giv me n eg. sequence of triangles. this maybe too rudimentary, but im gettin confused
will it be the avg. of all the 7?
http://www.worldgeodata.com/images/triangles.jpg



[This message has been edited by mithun_daa (edited 02-09-2004).]

[This message has been edited by mithun_daa (edited 02-09-2004).]

ZbuffeR
02-09-2004, 10:29 AM
The actual number of triangles to take in account will depends if you have a corner/edge vertex or a 'standard' one of course.

In you example, for the vertex located right in the middle, you will need to average the normals of triangles 1,2,3,4,5,7. (quite a strange numbering, btw http://www.opengl.org/discussion_boards/ubb/smile.gif )

For the vertex at the up-right corner, use 6.
For the one just below, use 1,6,5.
And below again, use 5,4.

So, for each unique vertex, just take in account all the directly adjacent triangles.

Is it clearer ?

[This message has been edited by ZbuffeR (edited 02-09-2004).]