Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Creating Planet Rendering

Author
Message
Avoth
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location:
Posted: 11th Aug 2011 03:20 Edited at: 11th Aug 2011 03:22
I am trying to work out the most appropriate method to planet rendering.

My aim is to create a basic sphere from great distance but the sphere will gain greater detail the closer you get to it.

I thought about making multiple mesh with height maps and morph them into a sphere but it wouldnt work because as far as im aware you cant rotate terrains.

The only thing i can think of doing is making a basic sphere and updating its mesh to higher detailed meshes the closer the camera gets. This would work i believe would but cause another problem. The detail accross the entire sphere would be altered and the poly count would increase massively.

Is there a way to alter the section of the spheres detail the camera is closest too more than the rest in order to keep poly count as low as possible?

Or a completely different method of coding in order to achieve what im trying to achieve.
The Slayer
Forum Vice President
16
Years of Service
User Offline
Joined: 9th Nov 2009
Playing: (Hide and) Seek and Destroy on my guitar!
Posted: 11th Aug 2011 03:37
Well, the best way IMO would be to use a shader that increases the detail the closer you get to the planet. Using a diffuse texture, a detail map and a bumpmap. So, the further away from the planet, the lower the detail of the textures used on the sphere.
The sphere would always have the same polygon count, but the shader would increase the detail on the sphere by checking the distance away from it, and applying lower/higher detailed textures, depending on the distance.

I dont know if there are any shaders on the forums here, though. Maybe Green Gandalf knows more about this.

Cheers

Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 11th Aug 2011 03:49
I can't find it but there was a really good example of this somewhere on the forums, a guy made a mesh which physically subdivided into greater and greater detail the closer you got to a particular region, when you got really close the mesh gradually flattened out to a flat planet surface terrain. Wish I could find it

Avoth
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location:
Posted: 11th Aug 2011 03:50
Its the poly count that is going to be the big issue. Alot of terrain editing programs use a feature i am trying to establish the propper term for which reduces the mesh detail on areas further away from the camera (giving less detail which isnt realy noticed much)

There must be a way to mimic this in DBPro on mesh objects allowing you to in theory create a planet you can zoom to ground level with great detail in the vicinity (rest of the planet low or no detail) and zoom out to a eventualy a completely normal sphere (with no detail) thus keeping poly count to an absolute minimum... how that can be done is why i am here
Mr Bigglesworth
18
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 11th Aug 2011 07:09 Edited at: 11th Aug 2011 07:10
@Avoth: I belive what you want is called LOD (Level Of Detail). You could achieve by calculating the cameras distance from a object and setting the correct LOD level based on that distance.
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 11th Aug 2011 18:58
I believe Blitz Terrain will eventually (if not already) support spherical terrains. You could use this to generate a planet, which when far away is low poly, and at closer distances is higher poly?

My signature is NOT a moderator plaything! Stop changing it!
Avoth
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location:
Posted: 11th Aug 2011 23:59 Edited at: 12th Aug 2011 05:36
The only logical self programming solution i can come up with is to develope a sphere made of identicle triangles (icosahedron) with their own heigh maps and as you zoom in split the local triangles to greater depth applying more detail to the heighmap. Theory and progress are two different things though and as far as im aware you cannot manipulate a mesh's orientation/rotation in DBPro nor create a triangle terrain mesh.

Does anyone know if its possible to create a mesh from an object and then apply a heightmap to it? Or does the apply heightmap command only work with build terrain mesh. I would imagine even if you could apply a heightmap to an mesh created from an object, that it would position the points in a world Y direction causing all changes to be made in an upward direction rather than an outward from the center of the sphere.

My last and only thought would be to create a Cube to which i can split over and over and over applying height maps to the flat surfaces and then finishing it off by morphing the entire cube into a sphere. My only concern would be how the terrain would look aftering the cube had been arranged into a sphere.
Morcilla
23
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 12th Aug 2011 20:01
Quote: "I believe Blitz Terrain will eventually (if not already) support spherical terrains."

Yes, I would start looking here first, as this feature was on the list of Blitz Terrain.

Quote: "to create a Cube to which i can split over and over and over applying height maps to the flat surfaces and then finishing it off by morphing the entire cube into a sphere. My only concern would be how the terrain would look aftering the cube had been arranged into a sphere"

I've noticed that this is the way to go for many techniques out there. They use several curved planes to conform a sphere.

Avoth
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location:
Posted: 13th Aug 2011 01:32 Edited at: 13th Aug 2011 01:34
I have decided to go with the Cube to Sphere approach and am in the process of developing the Algo to form the heightmaps onto the flat edges then forming the Sphere from the result. The only thing i cannot seem to make work is splitting individual surfaces into multiple surfaces using DBPro. Any thoughts on the matter? Maybe im looking at it from the wrong angle and instead of creating a basic "object" to work on, i should be making my Cube from scratch point by point?

Login to post a reply

Server time is: 2026-07-10 12:02:00
Your offset time is: 2026-07-10 12:02:00