Commit Graph

9996 Commits

Author SHA1 Message Date
rdb 46189dc1bf Compile fix for macOS build
[skip ci]
2017-12-04 22:52:23 +01:00
rdb 2e20a0f16e Implement awaitable thread-safe future for async operations
This introduces AsyncFuture as a new base class of AsyncTask.  It's modelled after asyncio's Future class, except that it is thread-safe and you can use result() to block the current thread waiting for the future to finish (of course this is not necessary for use with coroutines).

AsyncFuture should be used for any operation that finishes in the future, to get the benefit of awaitability within coroutines as well as a standard interface for querying status and results of the operation as well as cancelling it.  As such, it's been implemented in various places, including texture.prepare() and win.trigger_copy().

Note that AsyncFuture is intended to be used *once*; it cannot be used more than once.  As an example of how this works, tex.prepare() will return the same future as long as the prepare isn't complete, but when it is done, subsequent calls to tex.prepare() will return a new future.
2017-12-04 22:25:28 +01:00
rdb 69b3468b2c interrogate: more improvements to seq/map wrappers
Gets rid of properties defined as both MAKE_SEQ_PROPERTY/MAKE_MAP_PROPERTY, which are just a bad idea. Instead, adds a way for map properties to define a separate "keys" interface.

Fixes: #203
2017-11-27 17:29:50 +01:00
rdb 3be22679a4 display: also avoid getting more than 24 color bits if 0 were requested
See issue #197
2017-11-26 00:06:03 +01:00
rdb 749b23a190 Fix support for pickling NodePaths (broken in 1b1d80c)
Fixes: #199
2017-11-25 23:12:47 +01:00
rdb 46c8852eed text: fix for certain versions of HarfBuzz 2017-11-20 20:40:51 +01:00
rdb 0edac2e94a Work around gamma issue with 64-bit color depths on NVIDIA hardware 2017-11-16 23:52:12 +01:00
rdb 001804113a ShaderGenerator: make colorscale/texture blending match FFP better
A notable change is that the color scale is now applied *before* texture blending, matching the FFP.  If this breaks anything, we might want to add a configuration option for this.
This also implements the remaining combine modes, CM_dot3_rgb and CM_dot3_rgba, and fixes the broken CM_subtract mode (which currently worked the same way as CM_add).

Fixes: #189
2017-11-16 15:58:13 +01:00
consultit e13d14fe3d bullet: add bam serializability of remaining shapes
From #123 with significant changes from rdb.

Closes: #123
2017-11-08 01:53:53 +01:00
rdb 1b1d80cd27 More thoroughly fix issues with pickling Panda objects in Python 3
This also adds DatagramBuffer, a class for writing datagrams to memory and reading them from there again.
2017-11-08 00:02:35 +01:00
rdb 08629ef1a0 Fix a few compiler warnings 2017-11-07 15:38:40 +01:00
rdb 483a491ed7 interrogate: simplify coercion code
This remove support for coercing non-ReferenceCounted types that are neither default-constructible nor move-assignable, but it turns out none of the classes we really need it for matches that.
It further cuts down on the amount of code that is being generated to support coercion in cases where it makes absolutely no sense.
2017-11-06 19:53:38 +01:00
rdb dd2806c8bd Mark constructors 'explicit' for which coercion makes no sense 2017-11-06 19:47:38 +01:00
Younguk Kim a26662ce46 Fix compile error by missing header file 2017-11-02 18:04:36 +09:00
rdb 075cb14cbb bullet: implement debug draw via cull callback for efficiency
Now the debug drawing will no longer happen if the debug node is not being visited by the cull pass, ie. in another scene graph.  Furthermore, the generation code has been optimized a bit more.

This change means it no longer inherits from GeomNode.  Future improvements could include better culling (which is currently disabled entirely).

Closes: #130
2017-11-01 21:55:54 +01:00
rdb 745b51f10f ShaderGenerator: fix M_blend to match fixed-function pipeline
See panda3d/panda3d#178
2017-11-01 20:20:38 +01:00
rdb c17db98aec Merge branch 'pr-pview-adjust-camera-clip' of git://github.com/eswartz/panda3d 2017-10-31 20:15:38 +01:00
rdb 4cd826e63a Merge branch 'fix-audio-distance-factor' of github.com:nikolmiv/panda3d
Closes: #13
2017-10-31 19:31:27 +01:00
frainfreeze f22c0cdd83 Add README.md files for various directories
Closes: #10
2017-10-31 19:20:24 +01:00
rdb 0c0f9adab9 Support coroutines and async/await in the task manager and loader 2017-10-31 18:56:41 +01:00
rdb 51090ccf12 pgraph: fix LightLensNode assert due to bad refcount in LightAttrib::compose 2017-10-20 20:12:25 +02:00
rdb 407c8e8712 bullet: add interface to access BulletTriangleMesh vertices/triangles 2017-10-20 19:53:02 +02:00
rdb 8a35f360bd Fix build error 2017-10-18 12:29:44 +02:00
rdb 7d721a33a6 Restore setShaderInput overload taking 4 numbers, but deprecate it 2017-10-18 11:26:20 +02:00
rdb 410049fd4b Improvements for ShaderGenerator-based programs:
* Disable state munger, which isn't needed
 * Reflect updates to TextureStage properties (Fixes #178)
 * Also respect combine mode and rgb scale changes
 * Allow rehashing and clearing generated shader cache

State munger is now disabled whenever any shader is applied.  Panda assumes that any custom shader will apply color scale by itself.
2017-10-18 11:16:29 +02:00
rdb 6ecfcb1fd3 Store munged states more efficiently, without weak key maps 2017-10-17 23:21:38 +02:00
rdb 8078fa2b38 More efficiently store SimpleHashMap with empty values 2017-10-17 23:04:16 +02:00
rdb bb60e8c373 display: fix segfault when output is removed during render
Fixes: #176
2017-10-15 18:48:53 +02:00
rdb 0db3d27247 ShaderGenerator: fix updating color of combine stages with CS_constant
This also changes the function of TextureStage::uses_color(), which no longer incorporate TextureStage::involves_color_scale()

Fixes: #177
2017-10-15 17:06:59 +02:00
rdb 51d948a7fa Support compilation for Python 3.7 2017-10-13 12:40:47 +02:00
Eric Klawitter 5758fdf8f5 Fix 'of of' doc typos 2017-10-09 14:56:40 -05:00
rdb bf190f7306 interrogate: support MAKE_MAP_PROPERTY 2017-10-09 00:02:46 +02:00
rdb 0e2b14cf4c pgraph: custom binding for set_shader_input()
Should be faster and more reliable at PTA handling
We no longer need the interrogate perf hack for the first-arg InternalName

Fixes: #161
2017-10-08 17:50:28 +02:00
rdb 8ed85c80c8 linmath: permit single-argument/fill value for UnalignedLVecBase4 2017-10-06 23:59:17 +02:00
rdb dfa47e55ce express: fix PTA get_data in Python 3, fix CPTA construction
Fixes: #173
2017-10-06 18:24:32 +02:00
rdb be8f4de337 display: add_render_texture should set correct texture format 2017-10-05 17:35:31 +02:00
rdb 85a9cdd052 Add a way to get access to OpenGL texture index 2017-10-05 17:34:26 +02:00
Younguk Kim b71ee446e3 Add has_hook functions taking function pointer or callback data in EventHandler 2017-09-24 02:46:00 +09:00
rdb 019df482d6 windisplay: fix origin not changing upon window being dragged 2017-09-19 19:16:48 +02:00
rdb 35349b6224 Expose DatagramOutputFile to Python, add props to DatagramSink 2017-09-17 01:38:59 +02:00
rdb 82eec0302b ShaderGenerator: fix point light shadow regression
Fixes: #167
2017-09-04 13:03:37 +02:00
kamgha f09d767c6e pnmimagetypes: introduce png-compression-level PRC variable 2017-08-31 13:03:17 +02:00
rdb a925e0bcd9 x11: fix loading 24-bpp ico/cur image alpha with width 24 2017-08-29 23:51:15 +02:00
rdb bbdc5d2341 pnmimage: mark many heavy methods as BLOCKING to release GIL 2017-08-22 20:04:59 +02:00
rdb 4fae81947e Fix regression (since 6f8b379) causing crash in flattening edge case 2017-08-07 23:00:28 +02:00
rdb e3d8123940 glsl: fix broken shadowMatrix as member of named light input
Fixes: #157
2017-08-07 22:58:02 +02:00
rdb d1c34c3360 interrogate: support static properties 2017-08-07 22:04:56 +02:00
rdb 65ae1e16bc ShaderGenerator: support multiple normal maps
Uses Reoriented Normal Mapping to blend additional normal maps.

Fixes #156
2017-07-15 20:17:29 +02:00
rdb f79fbf25c3 ShaderGenerator: big overhaul, don't generate more shaders than needed 2017-07-10 21:55:27 +02:00
rdb 1b690e528f vfs: don't crash if copy_file can't open output file (LP 1687283) 2017-07-10 21:13:57 +02:00
rdb 8b3ad7348e cocoa: fix broken mouse events in fullscreen on macOS (LP 1500026) 2017-07-10 19:53:53 +02:00
rdb 925ce854d0 general: make DO_MEMORY_USAGE setting not change ABI compatibility 2017-07-10 19:50:09 +02:00
rdb 5fffbbce47 express: error if Windows-style path is used (LP 1429241) 2017-07-10 14:25:41 +02:00
rdb 2e5051ac04 bullet: fix crash when adding non-indexed GeomTriangles to trimesh 2017-07-10 01:54:37 +02:00
rdb 9a40febdb9 shadows: fix light buffer not being destructed after light removal
Fixes LP 1672089
2017-07-09 20:36:13 +02:00
rdb 1fd8af5acd express: add C++11 methods to ordered_vector 2017-07-09 19:56:56 +02:00
rdb 84520ce21c display: prefer 24-bit depth buffer on Intel over 16-bit 2017-07-09 19:53:23 +02:00
rdb a866f9fbcb audio: fix case of get_speaker_setup/set_speaker_setup methods 2017-07-09 15:47:09 +02:00
rdb e45af355cc glgsg: fix multisample FBO regression (on Intel Windows driver) 2017-07-09 15:32:13 +02:00
Younguk Kim e07e5d0203 Fix assert macros that cause a crash in non-debug 2017-07-05 19:49:46 +09:00
The Cheaterman 86cbdddd76 Fix float precision issues in bulletHeightfieldShape
Closes: #152
2017-07-03 22:36:22 +02:00
rdb fa1c480508 general: clean up use of override keyword 2017-07-03 12:56:23 +02:00
rdb 48c811e112 cull: remove GeomMunger stored on CullableObject 2017-07-03 11:47:59 +02:00
rdb f57a3f9cde Hack to remove build warning on MSVC 2010
Fixes LP #1700329
2017-07-03 11:13:02 +02:00
rdb 9c4151cb0f ShaderGenerator: fix TextureAttrib assertion
This was caused by af57c829d2 and was triggered by a change in TextureStage sort.
2017-06-22 13:36:47 +02:00
rdb 511b0c10e5 ShaderGenerator: don't generate a shader per Material 2017-06-22 13:35:46 +02:00
rdb c6dda2a44a vfs: Show IOError instead of AssertionError if read_file fails
The methods are marked non-BLOCKING since the GIL needs to be held while throwing exceptions.  We handle the GIL in the extension functions instead.
2017-06-20 21:52:22 +02:00
rdb b41496b17a Fix texpad/texpix inputs not updating (fixes CommonFilters resize issue) 2017-06-20 19:15:12 +02:00
rdb af57c829d2 ShaderGenerator: reduce combinatoric explosion of shaders
This is done by:
* Not considering the texture pointer when looking up a generated shader, only type
* Not requiring different shaders based on RescaleNormalAttrib
* Not looking at AlphaTestAttrib unless it is going to be relevant

This should dramatically reduce the number of shaders that are being generated for many scenes, especially since the only thing that differs from object to object is often just the texture.

These changes are also necessary to make b781995ef1 more usable, since prepare_scene may see a slightly different state than is encountered at render time due to code in CullResult adding in an AlphaTestAttrib or RescaleNormalAttrib.
2017-06-20 18:45:49 +02:00
rdb b781995ef1 ShaderGenerator: prepare_scene now invokes shader generator.
This also necessarily removes ShaderGenerator's dependency on a host window.
2017-06-20 16:16:30 +02:00
rdb 90f96fc1a9 Change SimpleHashMap implementation to improve performance of GC.
The new implementation stores elements contiguously and keeps a separate sparse array of indices, similar to the new PyPy and CPython implementations.  This vastly improves performance when iterating over the individual elements, such as when garbage collecting states, and decreases memory usage.
2017-06-12 19:58:02 +02:00
rdb ca2e96d296 Fix for certain libjpeg versions that override INLINE macro 2017-06-12 19:46:59 +02:00
rdb 6b882ac767 Fix slow garbage collect after using a lot of states 2017-06-09 20:12:49 +02:00
rdb 2e8d09a99c Workaround for compiler bug when producing debug build
(with thanks to consultit)
2017-06-09 19:48:44 +02:00
rdb 828f1c10ca Support loading Opus audio files via libopusfile. 2017-05-24 22:21:54 +02:00
rdb 257311cc0c physics: fix crash in edge case when PhysicalNode dies before Physical
Also add more assertion checks
2017-05-24 20:21:48 +02:00
rdb 904209b277 Split out interrogate jobs for dtool directories from express 2017-05-24 13:44:52 +02:00
rdb 53794e8e36 Get rid of unnecessary DisplayRegionBase class 2017-05-24 13:42:01 +02:00
rdb d576c6b638 Improvements to generated API docs, especially in direct tree.
Also add an entry point for pfreeze.
2017-05-24 13:30:21 +02:00
rdb c52bab1805 stb_image: update to v2.15, support 16-bit PNGs
Also removes SSE2 runtime detection, which was causing compilation issues on Fedora
Also now supports HDR images with #?RGBE header
2017-05-24 13:19:18 +02:00
rdb 68be3c6dfe More efficient light handling; sort lights by highest priority first 2017-05-15 16:59:44 +02:00
rdb a71a89acc2 putil: make UpdateSeq a literal type 2017-05-15 16:34:13 +02:00
rdb 7755a2e1c7 shadows: provide dummy shadow maps for nonexistent/noncasting lights 2017-05-15 14:50:50 +02:00
rdb 652f2d7f21 bullet: improve performance of adding geometry to BulletTriangleMesh 2017-05-14 22:17:41 +02:00
deflected 560fd4eb3d panda: Get rid of few warnings
- Correct missing override
        - Correct deprecated XKeycodeToKeysym
        - Correct deprecated @exec for FreeBSD pkg plist

Signed-off-by: deflected <deflected@users.noreply.github.com>
Closes #144
2017-05-14 00:02:33 +02:00
rdb 81e414030e Fix RenderState cache leak - gc did not work properly
(Thanks to deflected for helping to track this down)
2017-05-13 23:30:09 +02:00
rdb e15cfd74e8 Prevent assertion when calculating bounds for geom without vertices 2017-05-13 21:40:59 +02:00
wolfgangp a1a99c49c0 Buffer protocol support for (Const)PointerToArray of vectors and matr… (#148) 2017-05-06 02:16:07 +02:00
rdb 160f652d58 text: use HarfBuzz for text shaping; support right-to-left text 2017-04-25 12:25:31 +02:00
rdb e67ebd80cd glgsg: deal with false negatives with feature checks on Intel 2017-04-14 19:40:02 +02:00
rdb fa1b656961 glgsg: fix get_host() of GL FBO. Fixes LP 1672560 shadow bug 2017-04-09 22:14:20 +02:00
rdb f7af155e93 Compile with VS 2015 Express, build assimp on Windows 2017-04-03 13:57:40 +02:00
sean5470 97cd007af3 bam2egg: retain model nodes
added code to retain model nodes that are not DCS nodes.
2017-04-03 02:28:37 +02:00
rdb 2980bbc955 android: fix error when uploading BGRA image 2017-04-03 01:41:28 +02:00
rdb 6f8b379bda Big patch full of performance improvements
This particularly benefits applications with a lot of nodes.
2017-04-03 01:41:23 +02:00
rdb 163c923c82 Backport various fixes for 1.9.4 2017-03-31 18:08:49 +02:00
wolfgangp f773bf6328 Add properties to Bullet classes (#140) 2017-03-29 11:38:39 +02:00
rdb 605ac1189f text: kerning should respect text scale 2017-03-28 21:13:03 +02:00
rdb e1c0e7d1d4 text: add experimental kerning support, enabled by 'text-kerning' 2017-03-27 19:15:09 +02:00
rdb 9d05044a9f shadows: force interocular distance to 0 for shadow cameras 2017-03-23 12:22:34 +01:00