Commit Graph

139 Commits

Author SHA1 Message Date
rdb 9fad3dba60 general: remove macros for compatibility with non-C++11 compilers
Now that we require MSVC 2015, we no longer need all this nonsense, so we can write cleaner code.
2018-05-23 23:33:05 +02:00
deflected 30cf1dbbb1 pgraphnodes: Fixed the type of texture bytes in sceneGraphAnalyzer
- Corrected the type of texture bytes variable as it is possible
        to wrap it around

Signed-off-by: deflected <deflected@users.noreply.github.com>
2018-03-30 14:38:39 +03:00
Sam Edwards 9dd37e9dbc general: Add guards to ensure proper BUILDING_ macros defined
This is designed to sanity-check the buildsystem, ensuring that the
expected BUILDING_ macros are defined at the expected time. It
also helps catch cases where the wrong BUILDING_/EXPCL_ macros
are used.
2018-03-25 13:17:52 -06:00
rdb 319b331553 ShaderGenerator: fix M_modulate_gloss regression
It was mapping the alpha channel of M_modulate_gloss to the glow channel.
2018-03-11 16:40:21 +01:00
rdb 04352e152d ShaderGenerator: fix TextureStage mixup when stages are disabled
This fixes a regression that caused the wrong textures/stage settings to be applied when a texture stage was being optimized out (eg. when a normal map is present while lighting is disabled).
2018-01-26 15:39:30 +01:00
rdb 1cada85e6b ShaderGenerator: fixes for combine alpha blending 2018-01-15 12:20:27 +01:00
rdb 7ee9467f8d shadows: fix shadow buffer creation deadlock in multithreaded pipeline
Fixes #162
2017-12-30 17:47:15 +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 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
rdb dd2806c8bd Mark constructors 'explicit' for which coercion makes no sense 2017-11-06 19:47:38 +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 8a35f360bd Fix build error 2017-10-18 12:29:44 +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 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 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 9a40febdb9 shadows: fix light buffer not being destructed after light removal
Fixes LP 1672089
2017-07-09 20:36:13 +02:00
rdb 511b0c10e5 ShaderGenerator: don't generate a shader per Material 2017-06-22 13:35:46 +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 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 9d05044a9f shadows: force interocular distance to 0 for shadow cameras 2017-03-23 12:22:34 +01:00
rdb b113d9db55 Fix incorrect type hierarchy of HermiteCurve, PandaNode, ShaderGenerator 2017-02-20 00:32:05 +01:00
rdb da79c28a6c Add RectangleLight class 2016-12-19 23:29:42 +01:00
Sam Edwards 2933b8ed39 general: Fix missing includes. 2016-06-25 19:10:38 -07:00
rdb ce29ae490d Interrogate improvements, more properties, MAKE_SEQ_PROPERTY 2016-05-11 00:16:53 +02:00
rdb a2ae62dbda Introduce ability to write older .bam versions, down to 6.21
See https://www.panda3d.org/manual/index.php/Dev:Bam_Format
2016-04-29 16:30:41 +02:00
rdb 2b7ef9c787 Add SphereLight class 2016-04-16 12:30:07 +02:00
rdb f68bfab7a9 Add light.shadow_caster and light.shadow_buffer_size 2016-03-17 15:26:12 +01:00
rdb 2bf886fc5b Add premultiplied alpha mode, for convenience 2016-03-02 17:55:34 +01:00
rdb 2971915618 Bam 6.41: lenses and light changes, add max_distance 2016-03-02 17:54:49 +01:00
tobspr 0fcfb8e372 New file headers, new comment style 2016-02-17 17:47:48 +01:00
rdb 090e912ce6 Cleanup of comments and whitespace 2016-02-01 22:30:43 +01:00
rdb 3393454582 Metalness workflow PBR stuff, support light color temperatures, make light specular color tied to light color by default 2016-01-09 16:08:33 +01:00
rdb e4857a58bb Add many more Python properties 2015-12-24 16:17:34 +01:00
rdb 6480e82e3b First pass adding properties to many Panda classes 2015-12-10 16:23:06 +01:00
rdb 25451feb87 Improve shadow system, add point light shadows, GLSL shadow inputs 2015-12-07 21:12:07 +01:00
rdb 48808fe269 Add get_supports_hlsl check, fix shader generator for DirectX 9 2015-11-26 01:05:26 +01:00
rdb db3ab953e4 Remove ppremake, genPyCode, and all hacks created to support them 2015-11-09 19:06:49 +01:00
rdb 18ad6d1543 Replace many int params with size_t params where appropriate, and work towards fixing type conversion warnings 2015-10-07 18:58:26 +02:00
rdb c9434c5b85 Fix shadowed light copy constructor, fix point light lens orientations 2015-09-10 15:30:24 +02:00
rdb acc2a310d0 Change debug category for shader generator to pgraphnodes 2015-07-28 21:43:19 +02:00
rdb ef9908c277 More robust Cg support on non-NVIDIA card + automatically enable hardware skinning in Shader Generator 2015-07-07 02:51:48 +02:00
rdb 5d364d6128 Merge branch 'release/1.9.x' 2015-06-15 00:20:17 +02:00
rdb 6d0e4c2662 Correct scaling and normalizations of binormals and tangents in generated shaders 2015-06-15 00:19:52 +02:00
rdb 82e098e578 Move auto-rescale-normal handling out of GSG, support normalizing normals in shader generator 2015-06-13 18:20:18 +02:00
rdb 32fb6814e7 Merge branch 'release/1.9.x' 2015-05-14 17:18:20 +02:00
rdb 586c067d69 Fix shader generator memory leaks 2015-05-14 17:17:38 +02:00
rdb adb02a8f45 Compile out things irrelevant for target build, like ShaderGenerator when !HAVE_CG 2015-04-06 13:24:45 +02:00
rdb 16e7831566 Remove executable permissions from files that don't need them 2015-04-05 15:41:49 +02:00