Skip to content

Commit 8c419d0

Browse files
committed
Document new build_apps options in 1.10.13
1 parent 891383d commit 8c419d0

File tree

5 files changed

+112
-4
lines changed

5 files changed

+112
-4
lines changed

distribution/building-binaries.rst

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,14 @@ combination is:
176176
* - p3fmod_audio
177177
- Audio (including 3D audio) support using FMOD (note the licensing!)
178178
* - pandaegg
179-
- Enables support for reading .egg files (usually not necessary)
179+
- Enables support for reading .egg files. Generally, you should not include
180+
this, since .egg files are automatically converted to .bam during build.
180181
* - p3ptloader
181-
- Adds support for additional model formats beyond BAM
182+
- Adds support for additional model formats. You probably want to instead
183+
add those model extensions to the ``bam-model-extensions`` list.
182184
* - p3assimp
183-
- Adds support for additional model formats beyond BAM by using Assimp
185+
- Adds support for additional model formats. You probably want to instead
186+
add those model extensions to the ``bam-model-extensions`` list.
184187

185188
Note that some plug-ins use third-party libraries that may have different
186189
licensing terms from Panda3D. More information about these libraries can be
@@ -228,8 +231,13 @@ platform tags to increase these versions:
228231
- Set this to target the oldest 32-bit Linux distributions.
229232
* - manylinux2010_x86_64
230233
- Target 64-bit Linux distributions more recent than (more or less) 2010.
234+
No longer supported by Python 3.11, which uses manylinux2014_x86_64.
231235
* - manylinux2010_i686
232236
- Target 32-bit Linux distributions more recent than (more or less) 2010.
237+
* - manylinux2014_x86_64
238+
- Target 64-bit Linux distributions more recent than (more or less) 2014.
239+
* - manylinux2014_i686
240+
- Target 32-bit Linux distributions more recent than (more or less) 2014.
233241
* - macosx_10_9_x86_64
234242
- Target Intel Macs running OS X Mavericks or higher. Recommended.
235243
* - macosx_10_6_x86_64

distribution/list-of-build-options.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,20 @@ file_handlers
8989
User-defined file handlers for an extension override the default handler.
9090
By default, there is only one file handler registered: for .egg files, which
9191
runs egg2bam.
92+
93+
bam_model_extensions
94+
New in Panda3D 1.10.13. A list of model extensions that are automatically
95+
converted to .bam during build. Add extensions to this if you are using other
96+
file formats than .egg (such as .gltf and .glb for
97+
:ref:`glTF files <gltf-files>`).
98+
99+
strip_docstrings
100+
New in Panda3D 1.10.13. If true, which is the default, all docstrings will be
101+
removed as an optimization, and any use of ``__doc__`` will return ``None``.
102+
Set this to false if you need to keep these docstrings for some reason.
103+
104+
prefer_discrete_gpu
105+
New in Panda3D 1.10.13. On systems with both an integrated and dedicated
106+
GPUs, tells the driver that the application prefers to use the dedicated GPU,
107+
which usually provides higher performance. At the moment, this option is only
108+
implemented on Windows, and only for NVIDIA and AMD graphics cards.

optimization/performance-issues/motherboard-integrated-video.rst

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,51 @@ The following code can be used to determine which GPU is in use:
3030
3131
std::cerr << win->get_gsg()->get_driver_vendor() << "\n"
3232
<< win->get_gsg()->get_driver_renderer() << "\n";
33+
34+
Forcing Use of Discrete GPU on Windows
35+
--------------------------------------
36+
37+
On Windows, it is possible to force the NVIDIA and AMD graphics drivers to
38+
automatically select the high-peformance dedicated graphics card, by compiling
39+
special symbols into the main executable.
40+
41+
.. only:: python
42+
43+
While developing, the main executable is ``python.exe``, which does not set
44+
these symbols. But when :ref:`building an application <distribution>`,
45+
build_apps can automatically add these special symbols. Simply add this
46+
option to the build_apps options block in setup.py:
47+
48+
.. code-block:: python
49+
50+
'prefer_discrete_gpu': True,
51+
52+
This option is available as of Panda3D 1.10.13.
53+
54+
.. only:: cpp
55+
56+
Simply copy-paste the following symbols into the source file containing your
57+
main entry point:
58+
59+
.. code-block:: cpp
60+
61+
#ifdef _WIN32
62+
extern "C" {
63+
__declspec(dllexport) DWORD AmdPowerXpressRequestHighPerformance = 0x00000001;
64+
__declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
65+
}
66+
#endif
67+
68+
Forcing Use of Discrete GPU on Linux
69+
------------------------------------
70+
71+
On Linux, some drivers can be told to use the discrete GPU by setting
72+
``DRI_PRIME=1`` in the environment. However, this is not considered reliable at
73+
this time, so it is not done by Panda3D automatically. It is suggested to
74+
document this as a possibility for your end-users or add an option for this
75+
setting that can be disabled.
76+
77+
When distributing a .desktop file, it is also possible to add the following key
78+
to the file::
79+
80+
PrefersNonDefaultGPU=true

pipeline/gltf-files.rst

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,40 @@ the vertex shader:
131131
132132
binormal = cross(p3d_Normal, p3d_Tangent.xyz) * p3d_Tangent.w
133133
134+
Distributing glTF Models
135+
------------------------
136+
137+
.. only:: python
138+
139+
When :ref:`building your application <distribution>`, the plug-ins
140+
responsible for loading glTF models are not distributed along by default.
141+
It is much better to convert the model to the optimized .bam format for this
142+
purpose. As of Panda3D 1.10.13, this can be done automatically, by adding the
143+
extensions to the ``bam_model_extensions`` list:
144+
145+
.. code-block:: python
146+
147+
options = {
148+
'build_apps': {
149+
...
150+
'include_patterns': [
151+
# Make sure the gltf/glb file is being found
152+
'**/*.gltf',
153+
'**/*.glb',
154+
'**/*.jpg',
155+
...
156+
],
157+
# Models with these extensions are converted to .bam automatically
158+
'bam_model_extensions': ['.gltf', '.glb', '.egg'],
159+
...
160+
161+
.. only:: cpp
162+
163+
To avoid having to include the plug-ins with a distributed application, use
164+
the gltf2bam utility (provided with panda3d-gltf) or write a script to
165+
convert the model to .bam using :meth:`.NodePath.write_bam_file()` and ship
166+
the converted .bam file instead of the original source file.
167+
134168
External Links
135169
--------------
136170

pipeline/model-file-formats.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ For several formats for which Panda3D ships with a to-egg conversion tool,
206206
Panda3D can automatically do the step of converting the model to .egg on load.
207207
For example, Panda3D ships with a flt2egg converter, which can convert
208208
OpenFlight models to the Egg format. If you try to load a .flt file, Panda3D
209-
will implicitly invoke flt2egg behind the scenes.
209+
will implicitly invoke flt2egg behind the scenes. The plug-in responsible for
210+
this is called p3ptloader.
210211

211212
The formats supported by this plug-in are OpenFlight (.flt), LightWave (.lwo),
212213
AutoCAD (.dxf), VRML (.wrl), Direct X (.x), and Wavefront OBJ (.obj).

0 commit comments

Comments
 (0)