Spherical Terrain in T3D

Expanding and utilizing the engine via C++.
21 posts Page 1 of 3
JackStone
Posts: 67
Joined: Fri Oct 02, 2015 1:03 am
by JackStone » Thu Dec 24, 2015 9:58 pm
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.
JeffR
Steering Committee
Steering Committee
Posts: 777
Joined: Tue Feb 03, 2015 9:49 pm
 
by JeffR » Thu Dec 24, 2015 11:11 pm
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?
JackStone
Posts: 67
Joined: Fri Oct 02, 2015 1:03 am
by JackStone » Fri Dec 25, 2015 12:18 am
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:
https://youtu.be/efwWrF4n9s4

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

When I subdivide and run checks on every node, I get this:
https://www.youtube.com/watch?v=LADku0Q6R3Q

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

I would be very grateful for any help or advice!
JeffR
Steering Committee
Steering Committee
Posts: 777
Joined: Tue Feb 03, 2015 9:49 pm
 
by JeffR » Fri Dec 25, 2015 6:34 am
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.
JackStone
Posts: 67
Joined: Fri Oct 02, 2015 1:03 am
by JackStone » Fri Dec 25, 2015 9:08 am
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?
Timmy
Posts: 309
Joined: Thu Feb 05, 2015 3:20 am
by Timmy » Fri Dec 25, 2015 10:57 am
I'm with jeff, it does look like something is wrong with the seams or the neighbour storage is wrong, something along these lines. It is hard to tell from just a vid though.
JeffR
Steering Committee
Steering Committee
Posts: 777
Joined: Tue Feb 03, 2015 9:49 pm
 
by JeffR » Fri Dec 25, 2015 9:07 pm
JackStone wrote: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.
JackStone
Posts: 67
Joined: Fri Oct 02, 2015 1:03 am
by JackStone » Fri Dec 25, 2015 10:35 pm
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.
JackStone
Posts: 67
Joined: Fri Oct 02, 2015 1:03 am
by JackStone » Fri Dec 25, 2015 11:10 pm
This is my parsing function:
http://pastebin.com/DfDSZiKC

It's a little messy, I have been through it a number of times, making changes, and testing things.
JeffR
Steering Committee
Steering Committee
Posts: 777
Joined: Tue Feb 03, 2015 9:49 pm
 
by JeffR » Thu Feb 04, 2016 6:31 am
Hey Jack, as promised in irc, I dug up that old solar system sim engine I had a copy of.

The code is oooooold, but it could give you some ideas on how to tackle things. You'd have to modernize the render code, but the basics for setup should carry across:

http://ghc-games.com/public/iue.zip
21 posts Page 1 of 3

Who is online

Users browsing this forum: No registered users and 2 guests