Not sure if this is the right forum… but i wanted to report a possible problem on Apple M1 chip. I have a simple scene with the standard environment and Panda walking back and forth, alongside a couple of other models. Panda and my other animated models are rendering fine, no issues, but the environment is all black.
Is this a known issue? If so, is there maybe a configuration setting perhaps to combat this?
panda3d 1.10.9 (installed via pip)
Macbook Air (M1, 2020)
macOS Big Sur 11.2.3
(the same code and scene works fine with 1.10.7 on a different, older, Intel-based mac, if that helps)
Thanks for the explanation, this indeed looks like a shader issue.
My code is a bit disorganized and large to upload all of it, but i was able to reproduce the problem with just the Hello World tutorial that has been modified slightly to add lights and shadows. Here it is:
from math import pi, sin, cos
from direct.showbase.ShowBase import ShowBase
from direct.task import Task
from direct.actor.Actor import Actor
from direct.interval.IntervalGlobal import Sequence
from panda3d.core import Point3, Vec3, VBase4
from panda3d.core import DirectionalLight, AmbientLight
from panda3d.core import BitMask32, Material
r = 0.9
g = 0.85
b = 0.6
angle = -90
sun = Sun()
# Disable the camera trackball controls.
# Load the environment model.
self.scene = self.loader.loadModel("models/environment")
# Reparent the model to render.
# Apply scale and position transforms on the model.
self.scene.setScale(0.25, 0.25, 0.25)
self.scene.setPos(-8, 42, 0)
dlight = DirectionalLight('dlight')
dlight.setColor(VBase4(sun.r, sun.g, sun.b, 1.0))
dlight.setCameraMask(BitMask32.bit(1)) # allow some object not to cast shadows
dlnp = render.attachNewNode(dlight)
dlnp.setHpr(130, sun.angle, 0)
self.dlnp = dlnp
self.dlight = dlight
dlight.setShadowCaster(True, 2048, 2048)
alight = AmbientLight('alight')
alight.setColor(VBase4(0.4, 0.4, 0.4, 1))
alnp = render.attachNewNode(alight)
self.alnp = alnp
# Add the spinCameraTask procedure to the task manager.
# Load and transform the panda actor.
self.pandaActor = Actor("models/panda-model",
self.pandaActor.setScale(0.005, 0.005, 0.005)
# Loop its animation.
# Create the four lerp intervals needed for the panda to
# walk back and forth.
posInterval1 = self.pandaActor.posInterval(13,
Point3(0, -10, 0),
startPos=Point3(0, 10, 0))
posInterval2 = self.pandaActor.posInterval(13,
Point3(0, 10, 0),
startPos=Point3(0, -10, 0))
hprInterval1 = self.pandaActor.hprInterval(3,
Point3(180, 0, 0),
startHpr=Point3(0, 0, 0))
hprInterval2 = self.pandaActor.hprInterval(3,
Point3(0, 0, 0),
startHpr=Point3(180, 0, 0))
# Create and play the sequence that coordinates the intervals.
self.pandaPace = Sequence(posInterval1, hprInterval1,
# Define a procedure to move the camera.
def spinCameraTask(self, task):
angleDegrees = task.time * 6.0
angleRadians = angleDegrees * (pi / 180.0)
self.camera.setPos(20 * sin(angleRadians), -20 * cos(angleRadians), 3)
self.camera.setHpr(angleDegrees, 0, 0)
app = MyApp()
If i run it like this, it works well, but if i uncomment this line:
then the grassy environment turns black.
I have not yet tried the special wheel linked from 1.10.8 release notes. I guess i need a proper arm64 python for that… but will it help though? It sounds like it is best to wait until 1.11.0 release.
One more observation. Not sure if it helps, but just in case:
If i try the same code (as in the post above) on panda3d 1.10.8, with setShaderAuto() enabled, it works differently than 1.10.9: the environment isn’t black, and the light seems to be correctly illuminating things, but there are no shadows.
1.10.8 had a bug wherein shaders would not be loaded at all on the macOS build, so that can explain why it did work in 1.10.8 but without shadows. It would be more interesting to see if it worked in 1.10.7.