Terrain System

Full description moved to: http://wiki.github.com/Craig-Macomber/Panda3D-Terrain-System/

I’m developing a terrain system that should allow easy mixing of procedural content with specified content from the editor ( https://discourse.panda3d.org/viewtopic.php?p=44475 )

Web Build:
Infinite Ralph
http://craig.p3dp.com/webbuilds/Ralph.html

Latest Source: http://github.com/Craig-Macomber/Panda3D-Terrain-System
Older Source Download: http://craig.p3dp.com/ProjectZips/Terrain13.zip

Images:

larger Version: http://craig.p3dp.com/MiscPics/InfinateRalph.jpg

Sounds very exciting. Will the implementation be C++ or Python?

If I do it, it will all be python and shaders. I’m pretty sure that most of the speed issues will be on the GPU. If not, I’ll just crank up the tile size and flatten the meshes into larger chunks. Of corse, once it really works, any performance bottlenecks could be ported to C++ as needed.

Currently I’m thinking GeoMipTerrain tiles in the renderer. I’ll try and get a minimal renderer working soon.

Thanks for sharing with the Panda community!

[size=92]Actually, I just finished my own automatic terrain generator for a space game I’m making. Great timing I have :frowning:[/size]

Space games are really quite different (usually). This is only useful for height map based RPG like games. My space game also has a different separate terrain system.

Anyway, main post updated to show a inital render test using the height map.

Oops, I was under the impression that this WAS the one used in your space game. Sorry

I updated the download link it the first post. It now includes my minimal renderer implementation. It might actually be worth toying with a bit now.

Hm, if you’re using multiple GeoMipTerrain tiles, I’m very curious what you use to stitch them together - so that no seams appear. Did you use setBorderStitching?

Ability to efficiently have tiled (paged) GeoMipTerrains without seams is a feature that’s been on my todo list for a loong time, I just never got to doing it.

Oh, I do have seams. I used setBorderStitching too. I have other issues in my mind now though. I gotta get the baking system better.

Mirrored the demo file on http://downloads.shadownode.net/sonstiges/panda3d/Terrain4.zip
pm me for more uploads - i have some GB free…

Work continues. Texture sampling (other than map sampling) is now supported. This means I can now use noise textures, and other textures (like the grass one shown here).

Edit: Picture removed because there are now better ones in the first post.

No update to the posted source yet though. I need to clarify the license on my grass texture I’m using first.

Main post updated. New download, new pictures, new features. Better appearance, better performance. The documentation is getting a bit out of date in the release though, but it should run fine.

New file uploaded to: http://downloads.shadownode.net/list?pfad=sonstiges+panda3d
(There you can find the old version, too.)

Now things are getting interesting!
Try out the new updated release (see first post) to see the seamlessly tiled world procedurally generated as the camera moves with LOD! High frame rates (there is bad 3X over draw to be resolved, but the vertex counts and object counts are quite low), fast tile generation times (I need to work on the threading, so its disabled in this release. You will see glitches when a tile is made, but they are very short!)

My terrain algorithm tends to not make very many mountain ranges, but you start by one. Enjoy.

If you have any issues with the images (in the first post) or the download, I’ll host them somewhere else.

No new release yet, but I have been working on it. There is now support for texture combine modes meaning you can use the map rendering system to produce alpha maps for detail textures. (Texture splattering)

I’ve also speeded some thing up a bit, but there seems to be a slow graphics memory leak. I also broke the shading (I need to learn more about texture combine modes) I also think I need mipmapping.

Have a picture. Nothing really special here, but thats a tiled ground texture, with a size thats not an integer multiple of the tile size. It’s all seamless, between tiles, and for the most part, between LODs. (Still the horrible overdraw issues for LOD though) I’ll remove this image and replace it with a better one in the main post once a corresponding version is released.

-snip, picture removed, main post updated with better pictures-

New release including infinite ralph. Walk around an endless procedural terrain! Good luck finding any seams! (Seriously though, if you see any, let me know. I think they are invisible). There may be some seams in the distance from LOD, but they should be gone by the time you get there. Occasionally it will lag pretty bad when it is generating a tile. Eventually threading will be used to solve this.

The current source is pretty messy, especially infinite ralph when I threw together really quick.

you could use subdivision (e.g. catmull-clark) for making the terrain look even smoother…

There is no point. I could just render higher resolution height maps. I could easily make a 100 billion triangle mesh. The limit is what load you wish to present to the GPU.

Main Post updated again with a new release and some updated info.

Downloads are now on p3dp, so they should be reliable.

It now uses a new rendering system which is optimized for live generation of terrain tiles. It now renders all the necessary maps over many frames to reduce glitches in frame rate. This is done by using my new texture rendering queueing system which is designed to render textures efficiently one after another without disrupting the frame rate.

There have also been some improvements to the infinite ralph controls (now just main.py)

LOD is disabled in this release because it is done poorly and simply has lots of issues. I’ll have to find a better way.

Edit: Source on github: http://github.com/Craig-Macomber/Panda3D-Terrain-System

Edit: I got LOD working again, and pushed the fix into github, see above link. It actually runs pretty slick now :slight_smile:

Web Build: http://craig.p3dp.com/webbuilds/Ralph.html

In safari, using the shift key seems to make safari crash. Seems to work fine in firefox.

Also, LOD is working quite well now, and tile generation is much faster. It drops from about 170 fps to around 80 when generating tiles on my computer, and they get finished quite quick. No more jerky frame rates!