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!

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

Postby JohnJ » Wed Feb 20, 2008 10:59 pm

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.

For this message the author JohnJ has received kudos
User avatar
JohnJ
OGRE Expert User
OGRE Expert User
 
Posts: 975
Kudos: 4
Joined: 04 Aug 2005
Location: Santa Clara, California

Postby Seregvan » Wed Feb 20, 2008 11:54 pm

looks nice :D especially fps =) can you capture a video?
Seregvan
Gremlin
 
Posts: 167
Kudos: 0
Joined: 15 Dec 2007

Postby CaseyB » Thu Feb 21, 2008 12:02 am

How is the terrain being created? Heightmap?
Image
Image
User avatar
CaseyB
OGRE Contributor
OGRE Contributor
 
Posts: 1335
Kudos: 2
Joined: 20 Nov 2005
Location: Columbus, Ohio

Postby JohnJ » Thu Feb 21, 2008 12:08 am

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
JohnJ
OGRE Expert User
OGRE Expert User
 
Posts: 975
Kudos: 4
Joined: 04 Aug 2005
Location: Santa Clara, California

Postby Klaim » Thu Feb 21, 2008 12:10 am

Wow that's interesting O__O
User avatar
Klaim
Old One
 
Posts: 2565
Kudos: 60
Joined: 11 Sep 2005
Location: Paris, France

Postby skullfire » Thu Feb 21, 2008 12:20 am

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
skullfire
Gremlin
 
Posts: 150
Kudos: 0
Joined: 19 Mar 2005
Location: San Jose, Costa Rica

Postby RedEyeCoder » Thu Feb 21, 2008 12:23 am

This is really nice JohnJ, can't wait to see where this goes!
User avatar
RedEyeCoder
Gnome
 
Posts: 344
Kudos: 0
Joined: 16 Jun 2007
Location: Brisbane, Australia

Postby betajaen » Thu Feb 21, 2008 12:25 am

Damn nice!

Now will somebody use this and create a clone of Frontier Elite II for me. ;)
User avatar
betajaen
OGRE Moderator
OGRE Moderator
 
Posts: 3447
Kudos: 60
Joined: 18 Jul 2005
Location: Wales, UK

Postby draxd2007 » Thu Feb 21, 2008 1:01 am

betajaen : check this http://www.a-astra.com/
To bad is not opensource
draxd2007
Kobold
 
Posts: 31
Kudos: 0
Joined: 07 Jul 2007

Postby JohnJ » Thu Feb 21, 2008 1:01 am

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
JohnJ
OGRE Expert User
OGRE Expert User
 
Posts: 975
Kudos: 4
Joined: 04 Aug 2005
Location: Santa Clara, California

Postby RedEyeCoder » Thu Feb 21, 2008 3:01 am

Is it possible to see a shot from the perspective of a human standing on the ground?
User avatar
RedEyeCoder
Gnome
 
Posts: 344
Kudos: 0
Joined: 16 Jun 2007
Location: Brisbane, Australia

Postby mr. iknoweverything » Thu Feb 21, 2008 4:06 am

Tryin to rain on Hexidave's parade?

Funky Framerates though. Any special tricks involved?
mr. iknoweverything
Halfling
 
Posts: 72
Kudos: 0
Joined: 12 Jul 2007
Location: berlin

Postby JohnJ » Thu Feb 21, 2008 4:41 am

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
JohnJ
OGRE Expert User
OGRE Expert User
 
Posts: 975
Kudos: 4
Joined: 04 Aug 2005
Location: Santa Clara, California

Postby HexiDave » Thu Feb 21, 2008 6:14 am

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
HexiDave
OGRE Expert User
OGRE Expert User
 
Posts: 1538
Kudos: 1
Joined: 14 Jan 2006

Postby RedEyeCoder » Thu Feb 21, 2008 7:00 am

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
RedEyeCoder
Gnome
 
Posts: 344
Kudos: 0
Joined: 16 Jun 2007
Location: Brisbane, Australia

Postby Alexander » Thu Feb 21, 2008 7:41 am

This looks kick-ass!
User avatar
Alexander
Gremlin
 
Posts: 175
Kudos: 0
Joined: 05 Aug 2006

Postby lf3thn4d » Thu Feb 21, 2008 8:10 am

Cool! Paging geometry support as well? :P
The planet must have tress and grass! Hehe. Great work! :)
User avatar
lf3thn4d
Orc
 
Posts: 478
Kudos: 12
Joined: 10 Apr 2006

Postby syedhs » Thu Feb 21, 2008 8:50 am

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.
User avatar
syedhs
Silver Sponsor
Silver Sponsor
 
Posts: 2700
Kudos: 47
Joined: 29 Aug 2005
Location: Kuala Lumpur, Malaysia

Postby bharling » Thu Feb 21, 2008 10:54 am

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
bharling
Gremlin
 
Posts: 166
Kudos: 0
Joined: 30 Jun 2006

Postby ghoulsblade » Thu Feb 21, 2008 2:47 pm

uuuh, sweeet =D
ogre+lua= http://lugre.sf.net spacegame: http://sfz.sf.net ultima-online 3d client : http://iris2.de
User avatar
ghoulsblade
Halfling
 
Posts: 83
Kudos: 0
Joined: 05 Mar 2006
Location: Munich, Bavaria, Germany

Postby eLunir » Thu Feb 21, 2008 3:07 pm

Great work, JohnJ! Congrats on another epic project!

But are you planning to develop further though, or was just fun & some learning?
eLunir
Gremlin
 
Posts: 181
Kudos: 0
Joined: 17 Jan 2008

Postby sinbad » Thu Feb 21, 2008 6:03 pm

Excellent work!
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
 
Posts: 19261
Kudos: 69
Joined: 06 Oct 2002
Location: Guernsey, Channel Islands

Postby JohnJ » Thu Feb 21, 2008 6:05 pm

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
JohnJ
OGRE Expert User
OGRE Expert User
 
Posts: 975
Kudos: 4
Joined: 04 Aug 2005
Location: Santa Clara, California

Postby Evak » Thu Feb 21, 2008 7:41 pm

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
Evak
Orc Shaman
 
Posts: 707
Kudos: 1
Joined: 02 Apr 2006
Location: Sacramento, CA

Postby Lord Alexion » Thu Feb 21, 2008 8:21 pm

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
User avatar
Lord Alexion
Kobold
 
Posts: 29
Kudos: 0
Joined: 19 Oct 2005
Location: São Paulo, Brazil

Next

Return to Showcase

Who is online

Users browsing this forum: Exabot [Bot] and 3 guests