Commit Graph

1060 Commits

Author SHA1 Message Date
rdb 2ef70579c8 display: remove reference to non-existent HardwareChannel class
[skip ci]
2019-07-12 12:59:46 +02:00
rdb 6df700939a glsl: make ParamVecBase4 and ParamVecBase4i work with ptr inputs 2019-04-14 23:08:02 +02:00
rdb e98fbc7633 Merge branch 'release/1.10.x' 2019-03-29 13:44:50 +01:00
rdb 63a764a61b display: fix missed cases in 364d5d82fe 2019-03-29 13:28:12 +01:00
rdb 364d5d82fe display: don't apply color-scale-via-lighting to shader inputs
This isn't working properly at the moment, since the state gets set for the *next* object, causing significant artifacts.  I wasn't entirely sure whether to restore the "proper" behavior or not, since applications may be relying on one or the other behavior, but enabling this feature for shaders is a minefield and it's a lot better to just tell people to use p3d_ColorScale instead.
2019-03-26 23:12:41 +01:00
rdb d11d4e0d85 display: don't render shadow cameras whose frusta are out of view
This is done by collecting bounding volumes for each camera in a scene, and then only rendering a shadow camera if at least one of those bounding volumes overlaps with the shadow camera bounding volume.

Closes #560
2019-02-19 21:59:04 +01:00
rdb 80bb5c09fe Merge branch 'release/1.10.x' 2019-02-12 01:13:56 +01:00
rdb f741c9476f display: fix lighting being disabled when only AmbientLight is on 2019-02-10 16:19:45 +01:00
rdb fc90ca7fdf Merge branch 'release/1.10.x' 2019-01-20 17:02:15 +01:00
rdb 7d09451b2d display: remove unused iterator variable 2019-01-19 23:08:14 +01:00
rdb 193ae8a3a6 pgraph: take advantage of constant initialization for states maps
SimpleHashMap has a constexpr default constructor, so there is no static init ordering issue that requires us to allocate the states maps on the heap and then to leak them.
2019-01-07 18:40:30 +01:00
rdb 83374de0ff shader: don't use GENERIC profile to compile Cg shaders
Instead, make an educated guess of what the GSG we are going to be compiling this shader for wants to use as profile.
2018-12-31 14:01:26 +01:00
rdb 9382e09b7c display: fix returning reference to temporary in shader input
This might cause issues when the transform cache is off.
2018-12-31 13:13:45 +01:00
Sam Edwards 5d74411c37 display: Fix export/import macro for MouseAndKeyboard
It was moved here from device, so we should not use
EXPCL_PANDA_DEVICE anymore.
2018-12-28 20:59:14 -07:00
rdb bd6ef2b0ea Rename CollisionTube to CollisionCapsule (bam 6.44)
Adds ability to register "obsolete" names for certain types under older .bam versions, so that we are still able to write out old .bam files.

Fixes #347
2018-12-23 22:28:06 +01:00
rdb 7ed8b01a84 Merge branch 'input-overhaul' 2018-11-30 22:04:13 +01:00
rdb 585ba2d647 Prepare input API for multipointer support 2018-11-30 20:54:37 +01:00
rdb 2087d8ee84 device: change InputDevice enums to enum classes 2018-11-30 20:41:06 +01:00
rdb 97d4e32a06 general: use nassert_raise instead of nassertv(false) et al
Even a brief error message in the assertion is infinitely more useful to a user who is not at home in the source code, especially for assertions that may reasonably be triggered by honest user mistakes.
2018-11-28 17:35:20 +01:00
rdb 26fcf131c9 Merge branch 'master' into input-overhaul 2018-11-25 17:10:31 +01:00
rdb 7c0a77af78 display: disable depth test before DisplayRegion draw callback
Having depth test disabled is the default OpenGL state, and callbacks may quite reasonably expect to see the default state.  Kivy seems to expect this, for one.
2018-11-24 22:45:41 +01:00
rdb 254cea63bb display: fix assertion in threaded pipeline 2018-11-22 23:13:58 +01:00
rdb c18cdcf36e display: add support for debug markers, to help with debugging
This is useful when running Panda in a tool like apitrace, so that the different calls in a frame are ordered in a neat hierarchy.
2018-11-20 12:41:20 +01:00
rdb d902ea5ce4 display: don't render window if all its DRs are inactive
This is an optimization, which will skip begin_frame/end_frame for a buffer that isn't going to have anything rendered to it.  Affects the RenderPipeline.
2018-11-20 00:39:44 +01:00
rdb e759a1b605 display: give DisplayRegions a more recognisable name in PStats 2018-11-19 21:01:43 +01:00
rdb 8f73f95e79 display: make PStats clear collectors per-window 2018-11-19 20:02:38 +01:00
rdb 074c5187b0 Adopt new WindowProperties(size=(x, y), ...) short-hand
This is intended as replacement for WindowProperties.size(x, y), which is deprecated since it conflicts with the `size` property.  See #444.
2018-11-12 17:53:53 +01:00
rdb 357b6d3093 Merge branch 'master' into input-overhaul 2018-10-29 23:40:46 +01:00
rdb afc994b2fb display: fix crash when removing DisplayRegion in pipelined render
Maybe not a perfect solution; we should consider keeping the DisplayRegions around until they have gone through the entire pipeline.

Fixes #427
2018-10-28 11:48:05 +01:00
rdb df77bacf06 makepanda: compile graphicsStateGuardian.cxx separately, earlier
Since this still takes a long time to build, even with the previous change, it would be better for one CPU to chew on this in the background while the rest of the build continues.
2018-10-19 00:37:00 +02:00
rdb 175d7ff56b display: significantly decrease p3display_composite2 compile time
This applies to building with MSVC and Eigen specifically.  Apparently, fetch_specified_part is taking up most of the compile time here.  I have no idea why these changes in particular make it faster, but they just do.
2018-10-19 00:30:14 +02:00
rdb 30f1c8ba92 display: slight cleanup of graphicsPipeSelection.cxx
This seemed to halve the compile time of this file under MSVC.
2018-10-19 00:12:53 +02:00
Sam Edwards 2d80d6d063 general: Add missing includes and remove deprecated type
Credit for missing includes to @treamology in Git commit
16cfac4829

CGTableCount removed; modern macOS seems to call this
a uint32_t instead. I can find no reference to CGTableCount
in any documentation, and the (very old) source code I dig
up just typedefs it anyway.
2018-10-14 15:50:06 -06:00
Sam Edwards 84ed19e8a7 display: Add two missing includes
(lightAttrib.h and materialAttrib.h)
2018-10-12 21:49:49 -06:00
Sam Edwards 6f62396373 general: Resolve a few compiler warnings
- display: GraphicsWindowProc should have a virtual destructor,
           as it's meant to be subclassed.

- express: set_matrix_view helper should always fail an assert
           when 'size' is wrong, even on release builds.

- express: Fix filename capitalization on some #includes.
           They're normally Windows-only, where case doesn't
           matter, but it's better to be consistent.

- gobj: Fix typo.

- particlesystem: Remove BaseParticle::_last_position.
                  Last position is tracked by PhysicsObject now.

- windisplay: Heed warnings about casting bool to (PVOID).
              Also, per MSDN docs, SPI_SETMOUSETRAILS uses the
              uiParam argument and ignores pvParam, so pass the
              _saved_mouse_trails value in that way.
2018-10-12 15:37:40 -06:00
rdb 93a3e7e699 Changes to make ColorAttrib behavior more consistent:
- T_off now actually properly disables vertex colours
- T_vertex is now the default, to preserve the previous behaviour
- ShaderGenerator behavior is now the same as in the FFP
- tests are updated to verify new behavior
- tests now properly use vertex colours, previously they accidentally only used flat colors
- With color-scale-via-lighting off and no color scale, color is no longer munged
- p3d_Color in GLSL shaders is now properly set to white instead of black with T_off mode
- In DX9 shaders will now sample white color for absent or disabled vertex color

Fixes #401
Also see #371
2018-10-08 22:09:22 +02:00
rdb 14042faa3d Merge branch 'master' into input-overhaul 2018-10-08 01:25:33 +02:00
rdb 51414466da display: ignore material if no lights are applied
This fixes materials suddenly showing up when a color scale is applied and color-scale-via-lighting is set.

Fixes #404
2018-10-07 22:52:49 +02:00
rdb b0c9000000 display: fix assert when app exits before window fully opens
Possibly addressing #403
2018-10-07 21:41:02 +02:00
rdb 85752b06f5 device: delete InputDevice copy ctor / assign operator 2018-09-28 17:32:38 +02:00
rdb 9b85a28861 putil: rename MouseData to PointerData to be more inclusive 2018-09-28 17:18:38 +02:00
rdb e30b597926 Merge branch 'master' into input-overhaul 2018-09-16 12:28:22 +02:00
Sam Edwards 4695557a5d general: Don't require BUILDING_* for static builds 2018-08-31 23:54:32 -06:00
rdb 1d6c3f6486 Merge branch 'master' into input-overhaul 2018-08-26 19:03:21 +02:00
rdb 6cd59807dd Remove useless test_display.cxx file 2018-07-17 19:38:10 +02:00
rdb d4d582484f display: fix ability to make screenshots in multithreaded pipeline
Problem is that WGL is strict about binding context in different thread while it is still bound in another thread.  Either way we need to make sure the draw thread is not rendering, so if you call get_screenshot() from a thread other than the draw thread, it uses the GraphicsEngine to wait until the draw thread is idle and then asks it to do the get_screenshot().

Fixes #360
2018-07-05 19:02:37 +02:00
rdb 234fd675b1 Merge branch 'master' into input-overhaul 2018-06-23 23:24:09 +02:00
rdb 29a08932ea display: improve mouselook smoothness significantly, esp if low FPS
This problem occurs when movePointer is used to reset the mouse back to the center every frame, a very common way to implement mouselook on Windows (which has no relative mouse mode).  Any movement between the last event loop run and the call to movePointer is destroyed, resulting in quite choppy mouselook in most implementations.

The solution is for getPointer to always return the latest mouse cursor position.  This goes a long way but is not 100% perfect; see the discussion in #359 for other solutions.

Fixes #359
2018-06-22 23:58:56 +02:00
rdb 886e1c2f16 general: fix many compilation warnings in GCC 8 2018-06-19 00:37:28 +02:00
rdb c1fbeaea51 display: allow full access to all 4 of each aux buffer category
I think there was some confusion about how set_aux_rgba (and friends) worked; it seems the original intent was to toggle each individual buffer whereas it is actually interpreted as a count of how many of these buffers should be enabled.  We should try to clarify the API and/or replace it with something better as soon as possible.
2018-06-14 16:08:33 +02:00