GeoMipMap Calculations

Started by
4 comments, last by Darkbouncer4689 12 years, 7 months ago
Hey all,

I've searched a while and most of the topics on GeoMipMap terrain lead to dead links, so I'll start a new one. Sorry if it's beating a dead horse.

For the equation A = n / |t|

He says n is the near plane, but I'm assuming he means n is the distance from the eye to the near plane? Also, I am calculating |t| as tan(FoV/2), is that correct?

It seems that the variable tau is the only variable that we get to freely pick. In his paper he suggests a tau of 4 pixels. Anyone have recommendations on a good tau value? I'm sure I'll have more hold ups as I go along but that's all for now =)

Edit:
One more question, for each mipmap level, am I suppose to construct new VBO's for vertices/texcoords/indices, or just make a new indices VBO and still pass the mipmap level 0 vertices/texcoords (which is wasteful, but so is storing multiple copies of the data for each mipmap level)

Thanks!
Advertisement

Edit:
One more question, for each mipmap level, am I suppose to construct new VBO's for vertices/texcoords/indices, or just make a new indices VBO and still pass the mipmap level 0 vertices/texcoords (which is wasteful, but so is storing multiple copies of the data for each mipmap level)


You have one set of vertex data and shouldn't need more than one index buffer per lod (it would be mostly pointless to have different buffers per chunk, because the same index buffer works for all if you just correctly offset into your vertex buffer). Since you should try to store your vertex data in video memory, there is nothing wasteful about it (unless you intend to somehow update and deform your entire terrain every frame).
f@dzhttp://festini.device-zero.de
Thanks for the reply.

My design has a unique vertex, texcoord, and normal buffer for each block of terrain, but one index buffer that is reused (and one index buffer for each mipmap level). I'm assuming you mean one set of vertex data for each block and not one set of vertex data for the entire terrain, right?

As for the questions about calculating |t| and picking a value for tau, do you have any suggestions?

Also one more question to add.
de Boer states that delta is the change in height from a mipmap level and epsilon is delta's length in screen space pixels. How can you convert delta to screen space pixels (i.e. how do you compute epislon?)

My design has a unique vertex, texcoord, and normal buffer for each block of terrain, but one index buffer that is reused (and one index buffer for each mipmap level). I'm assuming you mean one set of vertex data for each block and not one set of vertex data for the entire terrain, right?


Technically you should be able to store a single vertex buffer for the entire terrain, a single index buffer per level and just store the offset into the vertex buffer for each chunk. But you shouldn't try to be overly clever and efficient in every tiny aspect right from the start.


As for the questions about calculating |t| and picking a value for tau, do you have any suggestions?
[/quote]

Nope. I was simply calculating the max. error per chunk and lod, scaled it by the chunks distance to the camera and used the lowest lod still below a given threshold. Obviously it makes sense to keep those values variable and preferably you should be able to set them at runtime to find whatever value works best with minimal popping.

However, I remember some thread talking about a terrain of 256x256. If that was you then: screw lod and fancy nonsense. You're wasting your time and are better off just brute force rendering that tiny bit of terrain.
f@dzhttp://festini.device-zero.de
Interesting. How could one use a single vertex buffer for the entire terrain? For a terrain larger than 256X256 you would have to have an unsigned int index buffer instead of unsigned short. I think any gains from having a single vertex buffer would be at the cost of a lot of extra memory.

I agree that for a 256X256 LoD is pointless. I would like my engine to be able to handle larger terrains if necessary, but if the scene only requires a smaller terrain I will just send it all to the gpu. My code is segmented enough to not use GeoMipMaps with just a few comments.

As for anyone else out there, I could use some help with calculating the constants.

Is the top coordinate of the near plane (|t| in Boer's paper) equal to tan(fov/2)?
What are some optimal tau values? (Boer suggests 4 pixels)

Thanks!
Not sure if anyone is interested in this topic, but I have continued implementing GeoMipMaps and am getting towards the end. My algorithm for computing the maximum change in height (delta) uses the previous mipmap level, (not the level 0 mipmap, unless computing for mipmap 1). Using this algorithm I have a mipmap level 3 that has a lower delta value than a mipmap level 2. I'm not sure what to make of this. Does it mean I can jump from mipmap level 1 straight to level 3 and elimate 2 all together, or am I making some mistake in my calculations.

Any help is appreciated.

This topic is closed to new replies.

Advertisement