Planet Rendering Engine preview (released Jul/20/2009)
-
- 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)
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:
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 .
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:
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.
-
- Gremlin
- Posts: 167
- Joined: Sat Dec 15, 2007 11:44 pm
-
- OGRE Contributor
- Posts: 1335
- Joined: Sun Nov 20, 2005 2:42 pm
- Location: Columbus, Ohio
- x 3
-
- OGRE Expert User
- Posts: 975
- Joined: Thu Aug 04, 2005 4:14 am
- Location: Santa Clara, California
- x 4
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).CaseyB wrote:How is the terrain being created? Heightmap?
Here: PlanetEngine Video (3 MB)Seregvan wrote:can you capture a video?
-
- Old One
- Posts: 2565
- Joined: Sun Sep 11, 2005 1:04 am
- Location: Paris, France
- x 56
-
- Gremlin
- Posts: 150
- Joined: Sat Mar 19, 2005 7:51 pm
- Location: San Jose, Costa Rica
-
- Gnome
- Posts: 344
- Joined: Sat Jun 16, 2007 7:29 am
- Location: Brisbane, Australia
-
- OGRE Moderator
- Posts: 3447
- Joined: Mon Jul 18, 2005 4:15 pm
- Location: Wales, UK
- x 58
-
- Kobold
- Posts: 31
- Joined: Sat Jul 07, 2007 2:30 pm
betajaen : check this http://www.a-astra.com/
To bad is not opensource
To bad is not opensource
-
- OGRE Expert User
- Posts: 975
- Joined: Thu Aug 04, 2005 4:14 am
- Location: Santa Clara, California
- x 4
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).Just a question, does mapping the cube with a sphere generate seams or general uv problems?
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).
-
- Gnome
- Posts: 344
- Joined: Sat Jun 16, 2007 7:29 am
- Location: Brisbane, Australia
-
- Halfling
- Posts: 72
- Joined: Thu Jul 12, 2007 5:39 pm
- Location: berlin
-
- OGRE Expert User
- Posts: 975
- Joined: Thu Aug 04, 2005 4:14 am
- Location: Santa Clara, California
- x 4
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.Is it possible to see a shot from the perspective of a human standing on the ground?
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.
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).Tryin to rain on Hexidave's parade?
Funky Framerates though. Any special tricks involved?
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.
-
- OGRE Expert User
- Posts: 1538
- Joined: Sat Jan 14, 2006 8:00 pm
- x 1
-
- Gnome
- Posts: 344
- Joined: Sat Jun 16, 2007 7:29 am
- Location: Brisbane, Australia
I am more interested in the geometry than how fancy your material isIt'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.
-
- Orc
- Posts: 478
- Joined: Mon Apr 10, 2006 9:12 pm
- x 12
-
- Silver Sponsor
- Posts: 2703
- Joined: Mon Aug 29, 2005 3:24 pm
- Location: Kuala Lumpur, Malaysia
- x 51
Yes JohnJ is kicking ass as usual! I think JohnJ is getting slightly bored developing PagedGeometry, so this maybe his new focus..
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.
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.
-
- Gremlin
- Posts: 166
- Joined: Fri Jun 30, 2006 1:04 pm
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.
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
-
- Halfling
- Posts: 86
- Joined: Sun Mar 05, 2006 2:55 pm
- Location: Germany
- x 2
-
- Gremlin
- Posts: 181
- Joined: Thu Jan 17, 2008 10:04 pm
-
- OGRE Expert User
- Posts: 975
- Joined: Thu Aug 04, 2005 4:14 am
- Location: Santa Clara, California
- x 4
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 funPlus, as you said, you're learning something that you enjoy, so bonus points.
Ok, here's a picture from ground level:am more interested in the geometry than how fancy your material is
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:
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.
Thanks. Yeah, I definitely plan on implementing something like PagedGeometry for planetary terrains, but I haven't even started on that yet.Cool! Paging geometry support as well?
The planet must have tress and grass! Hehe. Great work!
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.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.
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.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.
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.But are you planning to develop further though, or was just fun & some learning?
Edit:
Thanks . It seems the more I try to do in Ogre, the more Ogre surprises me with it's great flexibility .Sinbad wrote:Excellent work!
-
- Orc Shaman
- Posts: 707
- Joined: Sun Apr 02, 2006 7:51 pm
- Location: Sacramento, CA
- x 1
-
- Kobold
- Posts: 29
- Joined: Wed Oct 19, 2005 2:46 pm
- Location: São Paulo, Brazil
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
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