Jump to content
  • Advertisement
Sign in to follow this  
mcsoy0312

Sphere and GeoClipmap

This topic is 4430 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

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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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). . x
x . .(2) x <-- global mesh (x)
x . x
x 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 | R1
x x x x x x x x x x
| |
x-x-x-lllllll-x-x-x
R2 l l R2
x x x l l x x x
l l
x-x-x-lllllll-x-x-x
| |
x x x x x x x x x x
R1 | R2 | R1
x 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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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 | <

Share this post


Link to post
Share on other sites
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
| <- * eye
x |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 grid
x * ### * 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.

Share this post


Link to post
Share on other sites
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 ;-)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!