GeoMipMap begginer questions

experimenting with geoMipMap

I’m giving a try with geoMiMap since i love irregular random terrains, but unfortunately documentation is a bit cryptic in the panda manual, so here i throw a few questions:

Given a loaded geoMiMap terrain with a heighmap 129x129.png, not scaled, his nodePath scaled nodepath.setSz(10)…


  • my demo is 3rd person, so if i set the minLevel at any number greater than 0, my avatar doesn’t snap exactly at the terrain with getElevation(x,y,z*nodepath.getSz())

  • if i make a task to update the lod level with a big diference between setBlockSize(p.ex 64) and setMinLevel(p.e 0) the application makes sudden ‘freezings’ while running, like not being able to calculate all that ammount of data in a single smooth frame…

  • also updating the lod this way causes obvious drastic/ugly visual changes in the terrain, i wonder is there some way to fadein/out the lod transitions

  • being 3rd person camera, better to set focalPoint to the avatar instead than to the camera, cause camera always looks at avatar, also like this you get sure terrain is on max resolution in avatar feet for the collision to work fine, is that right?

  • how is working best at the moment is not updating the lod level at all, basically not adding any task to handle that, but of course, frame rate decreases drastically…

  • anybody could adress me to some tutorial/something for finding the way for ‘painting’ tiles in the terrain, better with multitexture, so textures get blured…

I’d really apreciate any ideas suggestions advising on these,
i can submit a zip source file if anyone interested, just don’t know how.
this is how it looks so far:


Thats correct. Though, if you set the minLevel to something like 1 or 2, the difference will be barely noticable. The minLevel is not intended to be used for close-up scenes, only when a highest quality level is not needed.

Correct. Keep your block size low for that. Though, if you make your block size too low, the terrain might tend have too much blocks – thats where Automatic Flattening kicks in.

Well, depends. If your camera can get far away from the avatar, it might be a problem. Having focal point at the avatar has its advantages, but also its disadvantages. Same for focal point at camera. Just try out and see which works best for you.

Not updating the LOD level means, if the avatar walks to the other end of the terrain, the terrain becomes quite low quality there. You can use bruteforce rendering, the terrain wouldn’t need to be updated at all and the terrain would be equal quality everywhere. In that case you could also make your block size equal to the terrain size. But, that would indeed give a framerate loss, depending on the terrain size and minLevel.

Thats easy using shaders, if you know Cg. Here is an example of a terrain shader I posted here:
There is also a different way to do multitexturing, by Treeform. I never tried it with GeoMipTerrain though, and can’t guarantee anything:

I see that farther away the terrain lod looks noticably bad, you need tweaking your Factor to make the terrain look better on the far away parts.

PS. The default values for GeoMipTerrain are horrid for some cases. Every case has its own values, and they need quite some tweaking and fine-tuning before you reach the perfect quality/performance level. The values strongly depend on the way your scene is organized and how your stuff is set up.

udating the lod with a task and with these settings


seems to work fairly well

some advise would be grat dough :slight_smile:

What exactly do you need advice on then?

well i don’t have any idea of what Cg is :smiley:
but since i always wanted to implement some grid based texturing blending textures on adjacents cells i think i should take a look
i’ll also try to swim in the Treeform code, the images looks amazing!

for the other issues i think i get it, just tune the thing for good relation quality/performance,

thanks a lot pror, ur just like the sun :slight_smile:

Ah. Shaders are programs executed on the graphics card instead of the computer, they come in several languages, like GLSL, HLSL, and Cg. Panda only supports Cg, it looks very much like C. (actually it means C for graphics.)
You put a shader script in a separate file (usually with .cg or .sha extension) and then load it into Panda3D using loader.loadShader, next you assign the shader to a model with setShader. It works just like textures.
I’ve posted a terrain texture blending shader in this post. If you have any trouble, I’d be glad to help.

My way of doing terrain blending will not work with geomipmap very well. It could be recoded to work with it at c++ level though. There are still better ways to do terrain blending we just need to read more Cg books.

well, for the moment i think i’ll try to adapt the treeterrain sample code from freeform, looks less harming for health than the cg shader approach :wink:

in fact, i feel like i have to walk a looong road in the shader world before since i am only an actionscript-website programmer…

one question, i’m thinking on hanging some kind of history/tutorial/snippets about my project in the panda3dprojects page

do u think that’s worth/usefull/possible?

Sure, I don’t see any reason why not.

I think so. I’m trying something similar so I wouldn’t be surprised if other new users also start off on the same sort of project.