Panda versioning issues/bugs

I’ve been using Panda 1.1 for a while. Today my artist exported some models from Max 8. They show up normally in Panda 1.2.3, but completely black in 1.1. Any clues on why? I’ve renormalized the normals, verified lighting is off, checked that vertex color is white, and verified the texture loads. Any clues on why this might happen?

A few other things broke when I tried to run my game with the newer Panda version. The operations floatQuat and floatVec2 are no longer supported (though Quatfloat and Vec2float are). Worse, texture repeat doesn’t seem to work. I am explicitly setting my WrapU and WrapV to Texture.WMRepeat, but my ground texture clamps for anything outside of the [0…1] UV range (using generated EggPolygon, EggVertex, etc). This was working perfectly in previous Panda versions.

I determined the answer to my first question. The textures were 16-bits per channel TIFs. Oddly, the previous Panda version doesn’t throw any warnings, despite not fully supporting it.

As far as I know, the texture wrap is still an issue, potentially a bug.

Actually, there was never any intention to define a floatQuat interface; it was always supposed to Quatfloat. But because of a previous bug with interrogate, float*Quat ended up incidentally working too. (This bug was also causing other, more serious problems, so we had to fix it.)

I’m unable to replicate the problem with the texture repeat. It seems to be working fine for me. Can you demonstrate the problem with a simple program?

David

This is set to run with any “texture.png”. When I run it with Panda 1.1, it fills the screen with the same image tiled many times (correct behavior). With the latest Panda, it shows the image in full once, with edge clamped color streaks to the edges of the screen (incorrect behavior).

from pandac.PandaModules import *
import direct.directbase.DirectStart
from direct.Task import Task

#easy vertex generator
def MakeEggVertex(x,y):
	v = EggVertex()
	v.setPos(Point3D(x,y,0))
	v.setNormal(Vec3D(0,0,1))
	v.setUv(Point2D(x,y))
	return v

eggdata = EggData()
vp = EggVertexPool('geometry')

#load texture
eggtex = EggTexture('texture.png','texture.png')
eggtex.setMagfilter(Texture.FTLinearMipmapLinear)
eggtex.setMinfilter(Texture.FTLinearMipmapLinear)
eggtex.setWrapU(Texture.WMRepeat)
eggtex.setWrapV(Texture.WMRepeat)

#setup vertices
v0 = MakeEggVertex(-5,-5)
v1 = MakeEggVertex(5,-5)
v2 = MakeEggVertex(5,5)
v3 = MakeEggVertex(-5,5)

#setup polygon
quad = EggPolygon()
quad.addVertex(vp.addVertex(v0))
quad.addVertex(vp.addVertex(v1))
quad.addVertex(vp.addVertex(v2))
quad.addVertex(vp.addVertex(v3))
quad.addTexture(eggtex)
eggdata.addChild(quad)

#compile egg data
eggdata.collapseEquivalentTextures()
eggnode = NodePath(loadEggData(eggdata))
eggnode.reparentTo(render)
eggnode.show()
print "eggnode is "+str(eggnode)

#setup camera and run
def ResetCamera(task):
	base.camera.setPos(0,0,10)
	base.camera.setHpr(0,-90,0)
	return Task.cont
taskMgr.add(ResetCamera,'pulse')
run()

Ah. The EggTexture class does not use the same symbols as the Texture class. They have similar names, but not the same numerical value.

Instead of:

eggtex.setMagfilter(Texture.FTLinearMipmapLinear)
eggtex.setMinfilter(Texture.FTLinearMipmapLinear)
eggtex.setWrapU(Texture.WMRepeat)
eggtex.setWrapV(Texture.WMRepeat)

Use:

eggtex.setMagfilter(EggTexture.FTLinearMipmapLinear)
eggtex.setMinfilter(EggTexture.FTLinearMipmapLinear)
eggtex.setWrapU(EggTexture.WMRepeat)
eggtex.setWrapV(EggTexture.WMRepeat)

David