Jump to content
  • Advertisement
Sign in to follow this  
evillgames

Spherical clipmapping one more time

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

Hey guys. At first - sorry for rethreating. I am trying to implement spherical terrain using 6 independent planar clipmaps. Problem that i am getting is that i can not synchronize lods of cube faces. You can see that on these screenshots: http://img134.imageshack.us/img134/3033/sc1j.jpg - it is right for each cube face http://img134.imageshack.us/img134/6405/sc2z.jpg - it is NOT right for both faces. Because of incorrect cube i get incorrect sphere here: http://img90.imageshack.us/img90/618/sphericalclipmaps2t.jpg I saw lot of people here that made this thing, therefore source will be great

Share this post


Link to post
Share on other sites
Advertisement
Hmmm, I'm not exactly sure what you are trying to do, but here is my sphereical terrain with LOD.

http://profile.imageshack.us/user/polypterus/images/detail/#58/asteroid1oq5.jpg

I subdivide a icosohedron, but I see no reason why you couldn't start with a cube and use the regular ROAM algorithm. In fact I know someone who does this and it works fine. I probably don’t understand your problem though.

Share this post


Link to post
Share on other sites
The problem is: if you will take a look at cube you will see different clipmap centers at 2 cube faces (it does not give me entire body). If i have sphere presented as 6 planes i need to sync planes

i will prephrase that: how have i to calculate centers of clipmap lods when i have 6 independent clipmaps ? do you see: clipmap lod centers do not coincide.

i do not want to use quad tree lod so far

Share this post


Link to post
Share on other sites
I think I'm a bit confused. I don't know a lot about clipmaps. Aren't they texture and not geometry? Your picture made it look like you are trying to do some sort of geometry LOD which is what I'm doing. So I gather you are just trying to use clipmaps (which in this case happen to resemble geometry) around a semi-perfect sphere and you aren't trying to generate actually varying LOD geometry then? In any case this seems out of my area of expertise. To me it almost looks like your maps are in reverse order or something. Shouldn’t the texture get smaller as you move away? Hopefully someone with more knowledge can answer this for you. Sorry.

Share this post


Link to post
Share on other sites
Here is my attempt at the same project.
In the first pic you can see that I have continuity across 2 faces, but not the third. The closest point is on the lower left face, the next closes face is the lower right face. The third closest face (top) is not positioned correctly with respect to the second face. I was unable to sync the 3 faces, and Im not sure its mathematically possible.

You could position the third face by hand, and it would look correct, but the "closest point" of that third face would not be mathematically correct.

http://www.dreamlands.to/temp/email14.jpg
http://www.dreamlands.to/temp/email15.jpg

Please notice that I correctly clipped all clipmaps! (shown in red)

Share this post


Link to post
Share on other sites
Quote:
Original post by evillgames
2Kitty. Yeah - you have understood me )) I need continuity. How do you achieve that ? what the closest point ?


If all you need is the closest point on each face I'm sure that could be figured out. The thing is, it's going to change once the face becomes part of the sphere so you have to figure it out as a sphere and project it back to the face. One thing you can do is project a line from the view point to the center of the cube and that will give you the closest point on the face that it passes though. However for the other faces the closest point will be on the edges which will be a circular section or an arc in 3D.

My guess is it will go something like: Take the plane containing the arc and find it it's normal (in short take the plane defined by the center and the two corner points); create a plane that contains the normal of the previous step AND the view point; intersect that plane with the circle of the arc; see if that intersection is in the arc and if not check the next arc. I'll have to think about this further to make sure it's correct but I'm sure there is some way to do it.

My bigger question is once you do this don't you still need contiguous texture coordinates to keep from getting seams? Those seem very hard if not impossible to generate on a sphere. Am I missing something?

Share this post


Link to post
Share on other sites
RE TC:
You dont have to worry about texture coordinates because they can be derived from the original cube. Each face has 0->1 texture coords based on sample position.

There is never a 1to1 relationship between the geometry coordinates, and the texture coordinates. ie they are recalculated every frame.

RE CP:
The closest point is the closest point on each plane based on where the camera is.
I created a ray that starts at planet center, and points to camera. Then I do a ray intersect plane.


RE Continuity.
Look at my previous image

http://www.dreamlands.to/temp/email14.jpg

It is a folding problem. You start with closest point(in this case the left face), and create all the clipmaps. The boundary above is correct, and the boundary to the right is correct, however when you fold the coordinate space around a corner, you get discontinuity between the 2nd, and 3rd closest faces. (in this case the right, and top faces). Any shifting of the top clipmap to match the left, and right face is mathematically incorrect.


I dont think there is a mathematically correct way of syncing 3 clipmaps. As it is, it renderes fine. As you get closer to the corner, resolution still increases. It only looks wrong in wireframe mode.

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!