Jump to content
  • Advertisement

Archived

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

BradDaBug

Geomipmapping and normals

This topic is 5585 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''ve been looking at Willem deBoer''s paper on geomipmapping, and i''ve been trying to implement it into my little landscape engine. So far so good, but now I don''t know what to do with my normals. Do I recalculate the normals using the geometry of the higher level mipmap? Do the old normals need to be averaged together to make higher level mipmaps? What do I do?

Share this post


Link to post
Share on other sites
Advertisement
i wouldnt touch them, after all the idea is to have the geometry just once and only use different index buffers for different lods (depending on the size even that is big enough). if you dont need ogl/dx lighting i would even consider to forget them and only calculate them when you need them (or store them in a normal map with only 3 byte per normal).

also the high detail normals might make the terrain look more detailed than it is.

Share this post


Link to post
Share on other sites
Wait, so I''m supposed to load the geometry once, then use some kind of table to keep up with the vertexes I need for that LOD? Like for level 0, it''d use them all, for level 1, it''d only point to 1/2 of them, etc?

I''ve been storing the geometry in these blocks. Each block has several different LOD''s associated with it. Each LOD has seperate geometry. It calculates the mipmapped geometry by smoothing the terrain, then throwing out half the vertexes.

If I threw out the normals, could I have a shadow map the same size as the heightmap, then stretch it over the whole terrain? Would that look ok? I don''t guess I need any real time lighting. I just want the terrain to look shaded in places it should.

Share this post


Link to post
Share on other sites
Yeh, that''s the method that''s traditionally used. Lighting by normals is not so well suited to terrains since you also have to take in to account self-shadowing.

Doz

Share this post


Link to post
Share on other sites
not to mention that lower lods will look pretty ugly with vertex lighting. and 3 floats less per vertex make quite a difference if its a large terrain.

also (though i would probably wait with that til you feel sure about what youre doing) you should be able to store the geometry only once for the whole terrain (or a large sector, depending on if you need to reload parts of it). if your indices consider that you wont have a single vertex stored twice. it would only be one index buffer per lod (well, a few more in fact, as you need linking pieces too).

example (vertices are numbered down->up and left->right like that:
2 5 8
1 4 7
0 3 6

so if your terrain is 256*256 and your patches 4x4 (not that this would be a good number) your indices might look like: 0,1,2,4, 256,257,258,259, etc. for highest detail and 0,4, 256,259 for lowest. now just use the right offset into the geometry in your drawarray/whatever call so it points to the lower left corner of the patch you want to render and you should be done.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!