thetestgame / panda3d-sprite

Library for using sprite sheets and animating them in the Panda3D game engine
MIT License
9 stars 0 forks source link

Setting GL 3.2 shader compatibility breaks sprite texture offsets #1

Open izzyboris opened 5 months ago

izzyboris commented 5 months ago

This is a niche/corner case problem, but wanted to document it here.

Using gl-version 3.2 shader compatibility settings causes the texture offsets on the animated sprite to break, always showing the full spritesheet image rather than the correct frame cell.

panda3d_sprite: 1.0.0 Panda3D: 1.10.14 via pip Python: 3.11.4 Windows 11

Adding these lines at the top of the 02-animate.py sample program demonstrates the problem. The full spritesheet is shown in place of the correct cell, causing it to appear static.

from panda3d.core import loadPrcFileData
loadPrcFileData('', 'gl-version 3 2')

The story here is I was using GL 3.2 shaders setting along with panda3d-simplepbr in a base library. These shaders don't really apply to 2D sprites, so wouldn't normally be used together, but this setting was left in the base library and had this hard-to-diagnose side effect.

pmp-p commented 5 months ago

iirc same on gles2/3 & webgl1/2