SDK 1.10.9 Release

Once again I am pleased to present a new version of Panda3D. This is a minor release with some significant bug fixes and improvements. We highly recommend upgrading if you are on 1.10.8. Go to the download page to check it out right away, or read on to learn more about some of the changes.

Regressions

Some regressions in 1.10.8 were addressed in this version. The most significant is that some macOS builds were not correctly built with Cg shader support enabled, and would not display these shaders correctly. Another issue was fixed relating to the interactive editing tools, in which an exception was reported that did not occur in 1.10.7.

AMD RDNA graphics glitches

Due to a regression in the AMD Adrenaline drivers, video cards from the RDNA line such as the Radeon™ RX 5700 XT would display garbled vertex color data in some situations, causing surfaces to flicker black in Panda3D games. A generous member of the community has kindly loaned an affected card, enabling me to track this problem down. I have reported my findings to the AMD driver team, but until they resolve it, I have implemented a workaround for this issue in the Panda3D renderer. This workaround is automatically activated if a card from the affected line is detected, but can also be manually activated by adding gl-support-vertex-array-bgra 0 to the Config.prc file.

Headless OpenGL rendering using EGL

Due to popular demand, support for rendering without a running X11 server has been added, leveraging the EGL library instead of the conventional GLX library. This makes it possible to use Panda3D for rendering tasks on a server that has a GPU but does not run a display server (and may not even have a monitor attached). It has been implemented via a special fallback render plug-in that is loaded only when opening the X11 display fails.

No change is needed to make use of this feature, as Panda3D will automatically try to open an EGL display if opening an X11 display fails. However, when deploying an application, it is necessary to add p3headlessgl to the list of plug-ins to be included if you wish to enable headless rendering using EGL, since it is not included by default.

Since it is becoming more popular to use Panda3D for these headless simulation purposes, we have also fixed an assortment of bugs relating to using EGL to render to an offscreen buffer, especially relating to getting the render result when multisample antialiasing is enabled.

Pickling

The direct.stdpy.pickle module, which can be used to serialize Panda3D objects to a byte string, had been somewhat neglected in the switch to Python 3. It has been fully patched up with support for the latest Python version.

Note that this module is identical to the built-in pickle module, however it is necessary to use Panda3D’s version of the module for Panda3D types in order to avoid serializing objects more than once. The built-in pickle module does not offer enough extensibility for us to address that problem. You can use direct.stdpy.pickle as a drop-in replacement.

By user request, we have also added pickle support for various Panda3D classes that could not previously be pickled, such as collision handler and traverser objects.

Deployment system improvements

By user request, it is now possible for Panda3D to automatically create log files containing a date or time in a deployed application. Activating this feature requires adding something like the following to the setup.py file, using strftime formatting syntax:

    "log_filename": "$USER_APPDATA/My Game/logs/%Y-%m-%d.log",
    "log_filename_strftime": True,

For compatibility reasons, this feature is disabled by default, requiring the explicit log_filename_strftime key to enable it. In Panda3D 1.11.0 and later, this will be enabled by default.

Further issues have been fixed when deploying with Python 3.9.2, which could cause an exception in the produced game. Deploying with Python 3.9 would also automatically pull in external dependencies such as pep517, toml and numpy due to a change in the Python standard library that conditionally imports these modules, causing Panda’s dependency finder to think they are dependencies of the game being built. This is worked around in the new version by ignoring the imports in question.

While deploying with Python 3.9 should work now, we still recommend using Python 3.8 to create production builds, since this version is known to be stable and is also the latest version of Python that still supports Windows 7.

We have also added built-in support for the pytz and pandas packages, which previously required custom setup.py changes before they could be used as dependencies.

Coroutine improvements

The support for coroutines and async/await in Panda3D 1.10 has been appreciated, and some rough spots have been found by the community that we were able to address in this release. One of them was the missing ability to await certain types of interval objects (such as Sequence and Parallel objects), which has been added. This makes it easy to suspend the current task pending completion of an interval, which can be a great way to implement transitions or cutscenes more easily.

It is also possible to pass coroutines to AsyncFuture.gather(...), which are now automatically scheduled as tasks on the current task chain. Furthermore, it is possible to use AsyncFuture as a truly general-purpose future class since it can now store any Python object as result. (Previously, only certain primitive types and Panda objects could be used with it.)

Reproducible Builds

The Reproducible Builds project aims to make the build process for open-source projects more deterministic. By avoiding processes that add non-deterministic information—such as build timestamps—to a compiled library, the build process will result in the exact same binary given the same version of the source code and compilers. This makes it possible to verify that the binaries that the project distributes have not been tampered with, since it becomes possible to replicate the entire process and produce a bit-for-bit identical version of that binary.

Panda3D has adopted several of the recommendations of this project, by implementing the SOURCE_DATE_EPOCH standard in our build system, which clamps all timestamps written into build artifacts to the date of the latest source code change. This feature is not at all a current priority for us, but it was an easy change to make, and it helps users of Panda3D applications who do find it important for their application to be built in a reproducible way.

Deterministic build features have also been added to various Panda tools, including the deployment system. If you wish to build a reproducible binary of your Python application, you must set the SOURCE_DATE_EPOCH environment variable to the UNIX timestamp of the latest change to your source code (which must be in the past) and PYTHONHASHSEED to 0 (which avoids non-determinism in Python’s dictionary implementation). This ensures that the resulting executable is bit-for-bit identical to another one generated under the exact same circumstances. Please note, though, that this is still fairly minimal and experimental, and does not yet apply to the zip files generated by the bdist_apps command.

Others

This was just a small sampling of the many changes that are part of the new release. Head on over to the download page and scroll down to see a more complete list of changes. Don’t hesitate to give us your feedback! You can do so in the comments below, in the forums, the Discord server or the issue tracker.

We’d also like to remind you that the 31st PyWeek challenge takes place this upcoming week. This is a challenge to develop a game using Python in a single week, either by yourself or as part of a team. If you ask me, an excellent opportunity to try out the new version of Panda3D and exercise your game development skills!