Sphere and GeoClipmap

Started by
4 comments, last by Lutz 17 years, 9 months ago
Hi, I'm trying to implement Geo clipmap on my planet renderer. I know how to generate a spherical grid. But I've problems to connect it with the planet sphere. The planet sphere is generated by subdivision of a cube or a icosahedron. I don't know how to connect the sphere to the grid without overlapping or leaving gaps. May someone point me out? Thanks. [Edited by - mcsoy0312 on June 25, 2006 4:53:37 PM]
Advertisement
my approach is somewhat similar to http://www.math.uni-bremen.de/~justen/Mich/planetrendering_gallery_e.html

the planet has it own sphere mesh.
and the local clipmap is independent on it.
I don't know how to visually combine them into one piece without leaving visable artifcats.
May someone point me out?
Thanks in advance.
So you took my approach - and found one of the pitfalls :-)

The way I did it is not nice, but works. I've simply clipped a quadratic region out of the global mesh. The quadratic region just fits the local clipmap-mesh. It looks like this (in 2D):
       lll    <-- local mesh (l)    .ll   ll. <-- clipping planes (.)  xx .     . xx x (1).   .    xx      . .(2)   x   <-- global mesh (x)x       .       xx               x x             x  xx         xx    xxx   xxx       xxx

I've added additional clipping planes to do the job. There are in total FOUR planes (only 2 in the 2D picture) - one for each edge of the clipmap mesh. Unfortunately, If you add all four planes at once, nothing is drawn and everything is clipped away, since the region where the global mesh should be drawn is not convex. So you have to render 4 passes, in each pass you add one of the clipping planes. This gives you roughly a 2x overdraw. This is the view from the top:
x x x x x x x x x x  R1  | R2  |  R1x x x x x x x x x x      |     |  x-x-x-lllllll-x-x-x  R2  l     l  R2x x x l     l x x x      l     lx-x-x-lllllll-x-x-x      |     |x x x x x x x x x x  R1  | R2  |  R1x x x x x x x x x x   

In regions R1: 2x overdraw
In regions R2: 1x overdraw

Hope you know what I mean. I'm tired and hungry. Can't think anymore.

Lutz
Thanks. Mr Lutz.
I'm inspired by your method. And I'm trying to use another way to reduce overdraw.
I use a clip plane to cut the sphere, with a cicular hole. and I place a square geoclipmap grid inside. The gaps are filled by another mesh.
xxx |
|
xx xx | <
Thanks. Mr Lutz. Your engine rock! :D
I'm inspired by your method. And I'm trying to use another way to reduce overdraw.
I use a clip plane to cut the sphere, with a cicular hole. and I place a square geoclipmap grid inside. The gaps are filled by another mesh.
       xxx     |               |        xx     xx  | <- clip plane               |  xx         xx|               | x             x               |x              |x                |              <-   * eyex              |x               |x              |x               | x             x               |  xx         xx               |    xxx   xxx  |               |       xxx     |       xxx                     xx     xx                   xx         xx              x             x       x       ***     x   * for border gap filler      **###**       # for geoclipmap gridx    *  ###  *  x      **###**       x       ***     x                 x             x                  xx         xx                    xxx   xxx                          xxx      

I've got the basic geometry works.
But I don't know how to solve the spherical UV mapping problems at the texture boundary. i.e. Whenever U at boundary should be 0 or 1.
I was able to solve this problem, when the UV was updated by CPU, as I was able to determine where is the triangle face. But when I move the code into vertex shader, I can't do it. Would you point me out how to solve the UV problem?
Thanks.
Many thanks for the flowers.

I'm not quite sure what your question actually is.
Do you have UV mapping problems with the global mesh or the clipmaps?
For the global mesh, I simply use a cubemap texture. This solves all mapping problems.
For the clipmaps, I use toroidal ("wrapping") UV coordinates.

Lutz (<- first name ;-)

This topic is closed to new replies.

Advertisement