Tiling in TextureStage.MDecal

Hey all,

I’m attempting to use MDecal (per panda3d.org/manual/index.php/Texture_Modes) with a scaled down and offset texture. However, the textures tiles over the entire UV space (covering up the initial texture) regardless of offset and scale.

temp = loader.loadModle("./objects/disc.egg")
ts.setMode(TextureStage.MDecal)
texture = loader.loadTexture("temp.jpg")
temp.setTexture(ts,texture)
temp.setTexScale(ts,2,2)
temp.setTexOffset(ts,-1,-1)

Any ideas?

I assume you mean that adjusting the offset and scale will change the placement and number of decal textures you see over the entire space, but you don’t see through the decal texture to the underlying texture anywhere.

This is normal, assuming you have repeat mode on your decal texture (which is the default for any texture). If you want only one copy, then turn off repeat mode:

texture.setWrapU(Texture.WMClamp)
texture.setWrapV(Texture.WMClamp)

David

The decal texture still covers the entire space, but rather than a tile it just ‘smears’ across the rest of the model. What can I do about this?

texture.setWrapU(Texture.WMBorderColor)
texture.setWrapV(Texture.WMBorderColor)
texture.setBorderColor((1, 1, 1, 0))

The Texturing section of the manual has more information on the various wrap modes.

David