GeoMipTerrain issue


I am trying to generate terrain from 257x257 png image.
But i get this error:

:grutil(error): Specified image does not have a power-of-two-plus-one size!
:grutil(error): No valid heightfield image has been set!
myImage = PNMImage()"Data/World.png"))

self.terrain = GeoMipTerrain("World")

Panda v1.7.0

Are you sure that Data/World.png is really 257x257?


Can you upload it? I’m able to load a 257x257 image fine. I wonder what is different about yours.

Also, can you try this line (before the read() call):

myImage.setReadSize(257, 257)

myImage.setReadSize(257, 257) not works :confused:

I can load it correctly, no errors. Are you sure that the right image is loaded? What does it print if you put this after the read() call:

print myImage
image: 0 by 0 pixels, 0 channels, 255 maxval.

That’s Strange. Image is in correct place.

Does the read() call return False? If so, the image failed to load, and that could explain why GeoMipTerrain chokes on it.

assert"Data/World.png"), "Failed to read!"

When i try this code:

myTexture = obj.loader.loadTexture("Data/World.png")
print myTexture

output :

2-d, 256 x 256 pixels, each 1 shorts, luminance

Try this:

from panda3d.core import getModelPath

myImage = PNMImage()"Data/World.png"))
1 Like

Thank you! Now its working fine. :slight_smile: