A quick 3d World...


Did you use Panda to load a .png from L3DT into a GeoMipTerrain and then create a bam file ? You need to set the Z scale before you call generate on the GeoMipTerrain. Something like show in the above post:

# Set up the GeoMipTerrain
terrain = GeoMipTerrain("genTerrain")
# Store the root NodePath for convenience
root = terrain.getRoot()

perhaps you don’t need to call root.setScale(4), but you do need to set some height with root.setSz()

I did exactly as said in the first post (i used that exact code to generate the .bam file). The resulting .bam file has around 270MB and i think that size is the reason it takes too much time to load and when it loads it’s really slow (FPS wise).

[edit] Yeah, i think i need to change the root.setSz() but i don’t know by how much.

So, can anyone help me on this problem? (a.k.a bump)

I managed to load the terrain properly, but with only the heightmap and texture. How do i load the other L3DT maps? Like, attribute map, light map, etc?


You can apply the light map as secondary texture with MModulate mode (the default). As for the attribute map; you’d probably need to write a shader for that, or separate it into alpha maps.

The thing is, i made the terrain in L3DT, generating only the heightmap, attributes map and texture map.
Then i loaded the heightmap and texture map to Panda3D, but it seems just too unpolished on Panda3D (compared to L3DT 3-D preview), so i’m guessing that it has to do with the attributes map.
Does it?

I’m not sure what you mean by “unpolished”. Is it not smooth enough? Is there not enough detail on the textures?

A picture is worth more than a thousand words:

In L3DT:

In Panda3D:

Thanks for your reply.

The differences I can see is that the L3DT terrain is more high-poly (you can change that in Panda too) and there doesn’t appear to be much texturing on the Panda terrain (which is indeed caused by the lack of detail maps).

Can you give me some hints on how to load those detail maps? I will show you my terrain code in some hours, but now i’ve got to go.
Anyway, if you can give me some tips, i would be thankful.

You’d probably need to write a shader for it.

Here’s my terrain code:

	self.terrain = GeoMipTerrain("")
	self.terrain.getRoot().setPos(0, 0, 0)
	self.zScale = 60

It’s really simple, i need to deactivate bruteForce and start playing with the LOD values.

So, how can i make a shader?

You’d need to study a shader language and then write the shader code to combine all those textures.

Wow, i thought i could simply load the Attributes Map that is exported from L3DT.

It might be possible to fiddle with the shader generator and texture combine stages and some image editing to get detail texturing to work without having to write a shader. The number of different land types will be limited, though.