Jump to content

Spherical Terrain in T3D


JackStone

Recommended Posts

For the last eight months to a year, on and off, I have been working on a Spherical Terrain System for T3D. This feature is vital to my current project, and I cannot proceed without it.


I have created the quad-sphere based terrain, applied noise to it, and implemented collision. I have also implemented a quad tree for each "face" of the terrain, and I am currently attempting to parse the quad tree in an efficient manner, to implement the Chunked Level of Detail that I need to increase the resolution of the terrain without slowing down the system.


I am feel I am very close to at least a proof of concept here, but I can't seem to get the optimisation/parsing working properly.


I also need to be able to scale the terrain up to an arbitrary size, which will cause additional problems with dynamic additions to the quad tree mesh, etc.


I am reluctant post the entire source code, since it is very long, and I doubt that there would be anyone willing to look through all that and try to figure out what's going on.


I require this feature for my current project. If I can't get it to work in T3D, I will have no choice but to look into engines like Unity, or others, but I may end up having the same problem there.


Is there anyone here that would be capable or willing to help me work through this? I would be prepared to pay for support, if I had to. I would like to keep the code under wraps for the time being, since I may be commericalising this in the future.

Link to comment
Share on other sites

Is this done as one single terrain block, molded to be in a sphere? Or is it multiple separate blocks stitched together?


Also, under what circumstances are you viewing the terrain? Are you ON the planet, ie a ground perspective? Or pulled back and viewing the entire thing?

Link to comment
Share on other sites

Ah, thanks for your reply! I wasn't sure which forum/site to post it on.


I don't mean to name drop, but I have a massive amount of information on my site here:

http://phoenixgamedevelopment.com/blog/?s=P-152


I've been working on this for a long time.


To answer your questions, I have created a custom implementation, I am not using T3D's terrain at all. I have six "terrains" created, and projected using a sphere projection algorithm. At the moment, I am just rendering one for testing purposes.


I am controlling the camera, starting from close distance, and moving backwards. The terrain renders fine up close, but when I move out, the quad tree parsing algorithm seems to fail. I get gaps appearing in the terrain, it's as if the distance checking functions don't work properly?


When I manually check every node in the quad tree, the terrain works beautifully, but of course there is no efficiency gain in doing that, so it is useless.


This is a video of the problem:



Notice the gaps in the subdivision, almost like nodes are being excluded?


When I subdivide and run checks on every node, I get this:



Which is correct, however, there is no efficiency benefit.


I would be very grateful for any help or advice!

Link to comment
Share on other sites

Oh man, I remember your blog now :)


And yeah, that's definitely odd. I do note that when you do the checks on every node, it still results in missing pieces at the seams. Is that just because the seams aren't yet configured to stitch? Or could that be part of the symptom of the problem?


Any chance you could toss up a code chunk pertaining to the quadtree stuffs? Hard to guess where the checks may be failing on a conceptual level.

Link to comment
Share on other sites

Ah, thank you!


Yes, I have not added any edge stitching code yet so I am assuming any weirdness there is due to that.


The quadtree is fairly well entrenched into the base code, what part of it do you need to see? The parsing of it, or loading?


I have a feeling its the parsing that is causing the problems, I could post that somewhere tomorrow, if it's of any use?

Link to comment
Share on other sites

Ah, thank you!


Yes, I have not added any edge stitching code yet so I am assuming any weirdness there is due to that.


The quadtree is fairly well entrenched into the base code, what part of it do you need to see? The parsing of it, or loading?


I have a feeling its the parsing that is causing the problems, I could post that somewhere tomorrow, if it's of any use?

 


Yeah, I'd say we start with the parse code, and can check the loading part if nothing strikes as an issue later.

Link to comment
Share on other sites

Hi, Thanks for the replies! I wasn't expecting anything until a days after christmas!


There are some issue with the seams, I assumed they were more minor, and I had planned to deal with them a little later, but it may actually be relevant to this.


I will post the parsing function once I get it uploaded, hopefully it is something obvious.

Link to comment
Share on other sites

  • 1 month later...

Oh, that's fantastic, thank you!


I had a look through your project, it looks great! You obviously spent a massive amount of time on this!


I hope that I will be able to find some information in there about how to correct the issues I have been having with spherical terrain, thanks again!


I think I underestimated the sheer amount of time it takes to get anywhere with virtual worlds, even with my best estimates!

Link to comment
Share on other sites

Nah, it's not mine. But I'd found it many years back and nabbed a copy because I thought it was incredible(the creator was awesome enough to do the full source with it). Kept a copy of it just in case planet rendering ever came up.


But yeah, definitely a lot of work to get something so big to render. Having ANY examples should help at least better hash things out though.

Link to comment
Share on other sites

  • 1 month later...

Yes, I came across something like this a little while ago, it's amazing how easy it is when you know what you're doing!

I think I am finally getting there with this though, I am just about to implement a midpoint displacement algorithm, hopefully that will go well.

Link to comment
Share on other sites

Yeah, I tend to get a bit envious of people that have such a solid grasp of the maths like that. They can put out some really elegant code.


Keep us updated about how it goes, spherical terrain is always cool to see in action.

Link to comment
Share on other sites

Yeah, I've been posting regular updates on my blog, I *think* I am making some decent progress! Although, I have said that many times before!


Is this the type of thing that would be useful as a T3D feature? Or is it too niche? Spherical Terrain, I suppose, isn't something that most people would really need...

Link to comment
Share on other sites

Would spherical terrain work the same as regular terrain? Ex. collision, placement of objects, terra-forming, scatter sky, etc.

Bc it would be cool to have the ability to create an entire open WORLD!

I wonder how long it would take to drive the Cheetah all the way around... :D

Link to comment
Share on other sites

Spherical Terrain would work exactly the same as regulare terrain with regards to collision and object placement, and terrain deformation too.


Adding skyboxes and oceans would be different though, since the terrain would be spherical, so a flat ocean plane or sky box wouldn't work.

Link to comment
Share on other sites

I have made significant progress with this, I have the chunked level of detail and the quad tree system finally done.


The only issues now are the fact that the collision doesn't seem to be working properly (The collision mesh that I am generating doesn't seem to be updating correcting every tick) and I have no idea where to start implementing texturing.


I will post and update in the next day or so with some more progress.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...