Planet Rendering Engine preview (released Jul/20/2009)

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
Post Reply
User avatar
JohnJ
OGRE Expert User
OGRE Expert User
Posts: 975
Joined: Thu Aug 04, 2005 4:14 am
Location: Santa Clara, California
x 4

Planet Rendering Engine preview (released Jul/20/2009)

Post by JohnJ »

Ever since I started 3D programming, I've always wanted to be able to make a futuristic game where you could seamlessly enter/exit planets, and explore everywhere (among other things :) ).

I considered working with Hexidave's OgrePlanet project and getting that all working, but decided I'd try making my own planet rendering engine from scratch would be more fun (and I'd learn more, since I've never created an LOD terrain system before).

I just recently started this little project, a planet rendering engine, and after about a week of work I think it's turning out very well. Everything is dynamically paged (thread-ready, although I haven't threaded it yet), has an practically infinitely scalable LOD system, and is very fast. Here's a preview:

Image
Image
Image
Image
Image

There's still a bit more to do though (dynamic lighting, further optimization), so it'll probably be a while longer before I release anything.

Feel free to post any questions or comments you may have :).
Last edited by JohnJ on Tue Jul 21, 2009 6:04 am, edited 1 time in total.
Seregvan
Gremlin
Posts: 167
Joined: Sat Dec 15, 2007 11:44 pm

Post by Seregvan »

looks nice :D especially fps =) can you capture a video?
User avatar
CaseyB
OGRE Contributor
OGRE Contributor
Posts: 1335
Joined: Sun Nov 20, 2005 2:42 pm
Location: Columbus, Ohio
x 3
Contact:

Post by CaseyB »

How is the terrain being created? Heightmap?
Image
Image
User avatar
JohnJ
OGRE Expert User
OGRE Expert User
Posts: 975
Joined: Thu Aug 04, 2005 4:14 am
Location: Santa Clara, California
x 4

Post by JohnJ »

CaseyB wrote:How is the terrain being created? Heightmap?
Yes, for now, although the engine uses a flexible loader system similar to PagedGeometry's so it can be modified to load from any source you want. A planet is basically a cube mapped onto a sphere, so you can apply 6 heightmaps currently (the planet in the screenshots above uses the same heightmap+texture for all 6 faces of the cube).
Seregvan wrote:can you capture a video?
Here: PlanetEngine Video (3 MB)
User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56
Contact:

Post by Klaim »

Wow that's interesting O__O
User avatar
skullfire
Gremlin
Posts: 150
Joined: Sat Mar 19, 2005 7:51 pm
Location: San Jose, Costa Rica
Contact:

Post by skullfire »

Really interesting. This could really be used on a game I was designing....

Just a question, does mapping the cube with a sphere generate seams or general uv problems?
I may have alzheimer, but at least I dont have alzheimer.
User avatar
RedEyeCoder
Gnome
Posts: 344
Joined: Sat Jun 16, 2007 7:29 am
Location: Brisbane, Australia

Post by RedEyeCoder »

This is really nice JohnJ, can't wait to see where this goes!
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58
Contact:

Post by betajaen »

Damn nice!

Now will somebody use this and create a clone of Frontier Elite II for me. ;)
draxd2007
Kobold
Posts: 31
Joined: Sat Jul 07, 2007 2:30 pm

Post by draxd2007 »

betajaen : check this http://www.a-astra.com/
To bad is not opensource
User avatar
JohnJ
OGRE Expert User
OGRE Expert User
Posts: 975
Joined: Thu Aug 04, 2005 4:14 am
Location: Santa Clara, California
x 4

Post by JohnJ »

Just a question, does mapping the cube with a sphere generate seams or general uv problems?
Not really. There's no distortion of the mesh of UVs near the seams as you would if you simply normalized a vector to convert to a sphere - this uses a special formula to uniformly map the polygons onto a sphere. There are seams in the planet in the screenshots above though, but only because the texture doesn't tile seamlessly (I tried it with one that does and it looks fine).

BTW, here's what I mean when I say "practically infinitely scalable LOD system": PlanetEngine Video 2 (2.5 MB)

I basically tiled the heightmap and texturemap in that video several times to make the planet 64 times larger than the 1024x1024x6 planet in the previous screenshots. Of course, it doesn't look nice when tiled like that, but it demonstrates the scalability of the LOD system.

The planet in this video, unoptimized, would have 805 million polygons. It runs at 500 - 1300 FPS in my engine.

Edit: Wow. I just increased the resolution again as a test, and a 32768x32768x6 planet renders at 300 - 1300 FPS. That would be 12.8 billion polygons unoptimized.

Edit #2: Fixed broken link to video (sorry about that).
User avatar
RedEyeCoder
Gnome
Posts: 344
Joined: Sat Jun 16, 2007 7:29 am
Location: Brisbane, Australia

Post by RedEyeCoder »

Is it possible to see a shot from the perspective of a human standing on the ground?
mr. iknoweverything
Halfling
Posts: 72
Joined: Thu Jul 12, 2007 5:39 pm
Location: berlin

Post by mr. iknoweverything »

Tryin to rain on Hexidave's parade?

Funky Framerates though. Any special tricks involved?
User avatar
JohnJ
OGRE Expert User
OGRE Expert User
Posts: 975
Joined: Thu Aug 04, 2005 4:14 am
Location: Santa Clara, California
x 4

Post by JohnJ »

Is it possible to see a shot from the perspective of a human standing on the ground?
It's possible, but currently the ground looks pretty blurry, since I only have basic texturing working right now (I could show you a screenshot if you want though). Once I get more advanced texturing (like splatting) and shading (like normal maps) working, it'll look just like any other terrain engine, except it's a spherical planet of course.

Also, you may have noticed that the terrain in the screenshots/videos suffers from the "stairstep effect", due to the fact I'm using a 8-bit greyscale heightmap. Increasing to 16-bit .RAW heightmaps will solve this problem.
Tryin to rain on Hexidave's parade?

Funky Framerates though. Any special tricks involved?
Well from what I can tell HexiDave's OgrePlanet uses an algorithm somewhat different from mine. My engine is basically an implementation of the "Chunked LOD" technique by Thatcher Ulrich, only it's adapted to be spherical (for planets).

The Chunked LOD algorithm is very CPU efficient and extremely batch-friendly, which is why I think the frame rates are as high as they are (also keep in mind that it's running on a GeForce 7800 GT and that this is rendering the planet only - there's no sky, grass, trees, etc. yet, as you can see). Also, in my implementation, my Planet class derives from the MovableObject class, which means I was free to implement the culling, LOD, etc. at a very low level, and therefore allowed me to optimize it quite well in terms of CPU usage. Before it occurred to me that I could define a MovableObject this way, I thought it wasn't going to be possible, since adding and removing Ogre's SceneNode's from the scene is actually suprisingly slow, as I discovered when trying to implement a dynamically paging entity system for PagedGeoemtry. But fortunately, Ogre gives you many levels of customization, so implementing just about anything possible :)

Also, I chose to create my own planet engine rather than start with HexiDave's not only because his was incomplete, but because this way I can more easily provide a tight integration between the planet rendering library and a planetary vegetation rendering library.
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Post by HexiDave »

Hey, power to ya - I'll eventually pick work back up on mine, but at least now people will have something to use rather than waiting for me to get to work again. Plus, as you said, you're learning something that you enjoy, so bonus points.
User avatar
RedEyeCoder
Gnome
Posts: 344
Joined: Sat Jun 16, 2007 7:29 am
Location: Brisbane, Australia

Post by RedEyeCoder »

It's possible, but currently the ground looks pretty blurry, since I only have basic texturing working right now (I could show you a screenshot if you want though). Once I get more advanced texturing (like splatting) and shading (like normal maps) working, it'll look just like any other terrain engine, except it's a spherical planet of course.
I am more interested in the geometry than how fancy your material is :)
User avatar
Alexander
Gremlin
Posts: 175
Joined: Sat Aug 05, 2006 3:55 am

Post by Alexander »

This looks kick-ass!
User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm
x 12

Post by lf3thn4d »

Cool! Paging geometry support as well? :P
The planet must have tress and grass! Hehe. Great work! :)
User avatar
syedhs
Silver Sponsor
Silver Sponsor
Posts: 2703
Joined: Mon Aug 29, 2005 3:24 pm
Location: Kuala Lumpur, Malaysia
x 51

Post by syedhs »

Yes JohnJ is kicking ass as usual! :) I think JohnJ is getting slightly bored developing PagedGeometry, so this maybe his new focus.. :wink:

On a serious note, do you intend to develop this code further toward Planetary sceneries or something like PLSM (or better, both! :) ). I prefer the latter much better hehe.
bharling
Gremlin
Posts: 166
Joined: Fri Jun 30, 2006 1:04 pm

Post by bharling »

Thats looking absolutely great.

As a short term solution for texturing and lighting, I have a modified version of the Triplanar texturing shader that incorporates perpixel lighting that you could use if you want. I can PM it to you. It means you'd only have to worry about the heightmap as the texture map would be automatically calculated.
Was here
User avatar
ghoulsblade
Halfling
Posts: 86
Joined: Sun Mar 05, 2006 2:55 pm
Location: Germany
x 2

Post by ghoulsblade »

uuuh, sweeet =D
eLunir
Gremlin
Posts: 181
Joined: Thu Jan 17, 2008 10:04 pm

Post by eLunir »

Great work, JohnJ! Congrats on another epic project!

But are you planning to develop further though, or was just fun & some learning?
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

Excellent work!
User avatar
JohnJ
OGRE Expert User
OGRE Expert User
Posts: 975
Joined: Thu Aug 04, 2005 4:14 am
Location: Santa Clara, California
x 4

Post by JohnJ »

Plus, as you said, you're learning something that you enjoy, so bonus points.
Yeah, terrain rendering's one area of 3D programming I've neglected learning so far, so I'm glad I'm learning about it now. Plus it's fun :)
am more interested in the geometry than how fancy your material is :)
Ok, here's a picture from ground level:
Image
As you can see, the ground is very jagged due to the 8-bit heightmap.

Also, here's a shot demonstrating the quadtree-based LOD system:
Image
Here I moved to a point on the ground, froze the LOD state, then backed off into space where you can see the effect. The LOD parameters were also modified to make the effect more visible.
Cool! Paging geometry support as well? :P
The planet must have tress and grass! Hehe. Great work! :)
Thanks. Yeah, I definitely plan on implementing something like PagedGeometry for planetary terrains, but I haven't even started on that yet.
On a serious note, do you intend to develop this code further toward Planetary sceneries or something like PLSM (or better, both! :)). I prefer the latter much better hehe.
I'm not sure what you mean. I intend to continue development on it to the point where you can render very nice looking, huge planets. I probably won't make it a flat terrain system if that's what you mean.
As a short term solution for texturing and lighting, I have a modified version of the Triplanar texturing shader that incorporates perpixel lighting that you could use if you want. I can PM it to you. It means you'd only have to worry about the heightmap as the texture map would be automatically calculated.
Well texture mapping is pretty much solved already (although I guess it can't hurt to try other method), but lighting could be helpful. I hope to implement some sort of normal-map & ambient-occlusion, based on the sun's position of course. I think nVidia FX composer has a CG shader that does ambient occlusion so I already have something to work with.
But are you planning to develop further though, or was just fun & some learning?
Yeah, I definitely plan on further developing this into something usable in a real game - not just a planet renderer, but integrated atmosphere/sky, clouds, vegetation, physics, possibly procedural planet generation tools, and maybe more.

Edit:
Sinbad wrote:Excellent work!
Thanks :). It seems the more I try to do in Ogre, the more Ogre surprises me with it's great flexibility :D.
User avatar
Evak
Orc Shaman
Posts: 707
Joined: Sun Apr 02, 2006 7:51 pm
Location: Sacramento, CA
x 1
Contact:

Post by Evak »

Damn, I always wanted to make something like a Elite game with planet landings. Nice to see someone tackling the problem with planets :)
User avatar
Lord Alexion
Kobold
Posts: 29
Joined: Wed Oct 19, 2005 2:46 pm
Location: São Paulo, Brazil
Contact:

Post by Lord Alexion »

Seems like I'm not the only one with the idea of making the next ELITE-like space sim huh?

I've been toying with that idea for quite a while now, however never had the time necessary to actually implement some solution for it (unfortunately my job takes up all my time... *sigh*). I've been reading some materials about planetary LOD geometry and trying to implement some things (nothing concrete so far) and I must say, WOW. I'm mesmerized.

Maybe you're interested in releasing the source for this? :) would LOVE to see how this goes with some atmospheric scattering shaders
Post Reply