689 Commits

Author SHA1 Message Date
rdb
42dff65e4d general: fix various unprotected debug() outputs
These should be protected by an is_debug() check so that they can be optimized out properly in a release build.  Setting check-debug-notify-protect in Config.prc can be used to track down cases of missed checks.
2019-08-03 10:33:43 +02:00
rdb
53612512d5 glgsg: more reliable check for core/compat profile
Fixes #643
2019-05-03 15:43:20 +02: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
669a655366 Fix ShaderBuffer cleanup assertion with state cache disabled 2018-12-26 22:47:14 +01:00
rdb
840f28ef18 glgsg: fix framebuffer_copy_to_ram format for float framebuffers 2018-12-19 12:43:39 +01:00
rdb
3adc7d977e glgsg: fix compilation in double-precision mode 2018-12-04 16:16:05 +01:00
rdb
3c6b6e47ec glgsg: don't call glLineWidth with higher value than maximum
Officially, in core profile OpenGL 3.2+, calling it with a value higher than 1.0 is an error, but many vendors seem to let us.  Apple's implementation does not.  It appears that checking the maximum line width is a way to deal with this.

Fixes #466
2018-12-04 15:53:56 +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
272f13023e glgsg: unbind buffers after draw callback
Some libraries (eg. Kivy) leave their buffers bound, so this takes care of that.
2018-11-25 16:46:38 +01:00
rdb
3f91615a22 glgsg: reset color write mask before calling draw callback 2018-11-23 00:23:52 +01:00
rdb
8ad0cb6b57 glgsg: add support for p3d_FragData fragment output
This is necessary for GLSL 1.30 which deprecates gl_FragData but does not yet support layout(location=) specifiers

Also fix some function pointer checks for pre-GL 3.0

Fixes #455
2018-11-22 23:55:54 +01:00
rdb
ec4b0825e9 glgsg: restore more OpenGL state after draw callback 2018-11-20 12:41:43 +01:00
rdb
53cec96c07 Fix draw calls being listed under Primitive Setup in PStats, etc.
Previously, all draw calls would be grouped under "Primitive Setup", rather than under the appropriate bin collector.  This commit fixes that and adds a few other useful collectors as well.
2018-11-20 12:41:30 +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
8f73f95e79 display: make PStats clear collectors per-window 2018-11-19 20:02:38 +01:00
Sam Edwards
a9dfd8352e general: Distinguish local/system includes
This changes includes so that local includes are consistently
#include "localFile.h"
while system and third-party includes are consistently
#include <systemFile.h>

This commit mostly converts the former to the latter; the two
exceptions are in android_main.cxx and fmodAudioSound.h, where
the reverse was necessary.
2018-11-10 18:00:10 -07:00
rdb
dfbe728bad glgsg: fix shader point sprites when not using core-only profile 2018-11-08 15:50:44 +01:00
rdb
90c13cbd4e glgsg: fix error downloading texture with WM_repeat 2018-10-17 17:32:19 +02: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
47496068d3 Show materials with only base color applied properly 2018-09-09 20:56:37 +02:00
rdb
2556d006f7 glgsg: a few version check tweaks 2018-08-05 13:09:25 +02:00
rdb
8348f16665 glgsg: fix incorrect behavior if mat has either ambient or diffuse
This might have only been an issue in some drivers (not sure, spec is a bit vague here).
Apparently we need to call glMaterial *after* the color material setting has been disabled for it to stick.

Fixes #369
2018-08-05 12:54:32 +02:00
rdb
02b32a5814 glgsg: support vertices-float64 in core profile shaders
Requires OpenGL 4.1 or GL_ARB_vertex_attrib_64bit extension.
2018-07-26 22:58:15 +02:00
rdb
359ce3e9ef glgsg: fix error with glObjectLabel and SSBO 2018-07-17 22:59:23 +02:00
rdb
b5194d9ff2 glgsg: pad SSBOs to 16 byte boundary (required by some drivers) 2018-07-17 22:59:15 +02:00
rdb
06539f5c66 glsl: support passing uint variables to shader 2018-07-17 22:32:34 +02:00
rdb
799f0b4f78 glgsg: work around driver bug extracting buffer texture data
Some drivers would report the wrong internal format.  But it's silly that we query the internal format anyway, since buffer textures have a fixed sized internal format.
2018-07-17 17:04:50 +02:00
rdb
828233a8f2 glgsg: support gl-depth-zero-to-one to get same NDC Z range as D3D 2018-07-12 14:13:32 +02:00
rdb
16daf08e42 glgsg: fix some GCC warning messages 2018-07-11 13:33:50 +02:00
rdb
96a48a6848 glgsg: fix issue with extract_texture_data and buffer textures
It would always extract the last-created buffer texture, not the texture in question.
2018-07-04 20:56:07 +02:00
rdb
94cbdc563b general: fix a few more compiler warnings 2018-06-30 17:19:23 +02:00
rdb
886e1c2f16 general: fix many compilation warnings in GCC 8 2018-06-19 00:37:28 +02:00
Sam Edwards
b2bfb31114 general: Remove using std::* from headers
Also remove most `using namespace std;` statements. The only one that remains is in py_panda.h.

Closes #350
Closes #335
2018-06-14 16:04:49 +02:00
rdb
b88bd99704 Various compiler warning fixes 2018-06-12 12:38:07 +02:00
Sam Edwards
e2b4353800 general: Replace NULL (and 0 as pointer) with C++11 nullptr
Exceptions to this replacement are:
- .c files
- Headers included by a .c file
- stb_image.h
- dr_flac.h
- Strings
- Comments
2018-06-03 16:35:13 -06:00
rdb
6b726fa697 general: fix various compiler warnings and issues exposed thereby 2018-05-30 11:09:35 +02:00
Sam Edwards
52e7c952b3 putil: Rename config_util to config_putil 2018-05-14 02:36:42 -06:00
rdb
3b4d4b0804 glgsg: fix broken upload of downscaled texture without mipmaps
Fixes #306
2018-04-30 19:13:54 -04:00
rdb
9638eb47eb Add support for geometry with adjacency information
Example code: https://gist.github.com/rdb/7cebb8941b962c59d5a092048efb3855
2018-03-01 21:20:19 +01:00
rdb
428c5cbbf3 gles2gsg: fix compilation error with OpenGL ES 2 2018-01-05 14:34:15 +01:00
rdb
7ee9467f8d shadows: fix shadow buffer creation deadlock in multithreaded pipeline
Fixes #162
2017-12-30 17:47:15 +01:00
rdb
f82a940878 glgsg: fix shader version in macOS 3.2+ context 2017-12-20 14:16:05 +01:00
rdb
e9a50c8898 texture: fix get_clear_data() return type, make it work with sRGB 2017-12-19 19:27:36 +01:00
rdb
e4e24eee56 glgsg: use T_float when downloading 24-bit depth textures
This is to match behavior with previous Panda3D versions.  See #212
2017-12-19 18:44:44 +01:00
rdb
29f50be15e Fix bug: copy-to-ram depth texture binding gets format set to RGB
This was a regression introduced by be8f4de33789cbb96551bb34b1ba85e7134d1e73

Fixes: #212
2017-12-16 21:03:08 +01: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
e45af355cc glgsg: fix multisample FBO regression (on Intel Windows driver) 2017-07-09 15:32:13 +02:00
rdb
48c811e112 cull: remove GeomMunger stored on CullableObject 2017-07-03 11:47:59 +02:00
rdb
7755a2e1c7 shadows: provide dummy shadow maps for nonexistent/noncasting lights 2017-05-15 14:50:50 +02:00
rdb
e67ebd80cd glgsg: deal with false negatives with feature checks on Intel 2017-04-14 19:40:02 +02:00