Commit graph

1859 commits

Author SHA1 Message Date
reduz
7bf90c7888 Improved shadow rendering efficiency
-Do not bind attributes that are not needed
-Improve a bit more how meshoptimizer interacts with Godot
2020-12-18 19:47:32 -03:00
reduz
d2302f53d6 Implement automatic LOD (Level of Detail)
-Happens on import by default for all models
-Just works (tm)
-Biasing can be later adjusted per node or per viewport (as well as globally)
-Disabled AABB.get_support test because its broken
2020-12-18 15:48:03 +01:00
Rémi Verschelde
c7b53c03ae
SCons: Add explicit dependencies on thirdparty code in cloned env
Since we clone the environments to build thirdparty code, we don't get an
explicit dependency on the build objects produced by that environment.

So when we update thirdparty code, Godot code using it is not necessarily
rebuilt (I think it is for changed headers, but not for changed .c/.cpp files),
which can lead to an invalid compilation output (linking old Godot .o files
with a newer, potentially ABI breaking version of thirdparty code).

This was only seen as really problematic with bullet updates (leading to
crashes when rebuilding Godot after a bullet update without cleaning .o files),
but it's safer to fix it everywhere, even if it's a LOT of hacky boilerplate.
2020-12-18 10:29:34 +01:00
Yuri Roubinsky
fe4c8e387b Added support for constants in shader case and array size declaration 2020-12-17 11:51:18 +03:00
Rémi Verschelde
9e49dbda2a
Merge pull request #44360 from bruvzg/ctl_punct_word_break
Add word breaks on punctuation characters.
2020-12-17 09:02:01 +01:00
reduz
bf77016c8a Reimplement skeletons and blend shapes
Uses compute shaders, which only once, on demand, and all in parallel.
2020-12-16 14:32:04 -03:00
Rémi Verschelde
92d4deedaa
Merge pull request #44286 from clayjohn/VULKAN-fixes
Fixes to recent Vulkan errors
2020-12-15 23:20:29 +01:00
Marcel Admiraal
9bc62bf449 Remove Generic6DOFJoint precision property 2020-12-15 10:14:48 +00:00
Rémi Verschelde
ddbdafbcf1
Merge pull request #44112 from winterpixelgames/PR-more-deterministic-and-reliable-2d-physics
make 2d constraint solving more deterministic by solving in push order
2020-12-15 08:45:30 +01:00
bruvzg
06ae77a320
Add word breaks on punctuation characters. 2020-12-14 11:36:13 +02:00
bruvzg
c1d261fdb0
[Complex Text Layouts] Add variable fonts support. 2020-12-13 18:43:39 +02:00
clayjohn
775e3db2e1 Fixes to recent Vulkan errors 2020-12-10 22:47:53 -08:00
Rémi Verschelde
9263f8eb4b
Image: Rename PVRTC{2,4} to PVRTC1_{2,4}, drop COMPRESS_PVRTC2
We haven't had a proper implementation for COMPRESS_PVRTC2 (which is PVRTC1 2-bpp) in years,
so let's drop it instead of keeping a compress type which doesn't work.

The other enum values were renamed to clarify that our PVRTC2 and PVRTC4 are respectively
PVRTC1 2-bpp and PVRTC1 4-bpp. PVRTC2 2-bpp and 4-bpp are not implemented yet.
2020-12-10 23:14:04 +01:00
Marcel Admiraal
e40ab06599 Rename TrackerHand enums
Renames:
TRACKER_LEFT_HAND -> TRACKER_HAND_LEFT
TRACKER_RIGHT_HAND -> TRACKER_HAND_RIGHT
2020-12-10 10:30:45 +00:00
Rémi Verschelde
114f97ff11
Merge pull request #44128 from KoBeWi/🧹
Cleanup unused engine code
2020-12-09 13:01:50 +01:00
Tomasz Chabora
2c048ea164 Cleanup unused engine code 2020-12-09 12:12:36 +01:00
bruvzg
644f739660
Static analyzer fixes:
Removes unused code in OS.
Fixes return types.
Fixes few typos.
2020-12-09 10:17:53 +02:00
Rémi Verschelde
c0e6962aa0
Merge pull request #44164 from madmiraal/g6dof-use-default-copy
Fix inconsistent Joint3DSW copy constructor and assignment declarations
2020-12-08 09:41:27 +01:00
reduz
2748b9a10d Add support for low-end 3D rendering.
-Reduce number of uniform sets from 6 to 4.
-Remove features in low end mode, in order to reduce the number of texture units fit to 16.
2020-12-07 20:50:57 -03:00
Marcel Admiraal
c013361bdc Fix inconsistent Joint3DSW copy constructor and assignment declarations 2020-12-07 16:29:58 +00:00
bruvzg
0ef483e9a9
[Complex Text Layouts] Performance optimizations. 2020-12-07 08:53:02 +02:00
Marcel Admiraal
a24c38d1a8 Rename Vector2.tangent() to Vector2.orthogonal() 2020-12-06 18:16:06 +00:00
Rémi Verschelde
744ab88884
Merge pull request #36382 from aaronfranke/unhide-the-hidden
Unhide hidden members by renaming them and rebind Mesh enums
2020-12-05 13:19:30 +01:00
Yuri Roubinsky
245d4af10c Frees CanvasShaderSDF reference (prevents warning at startup) 2020-12-05 11:28:44 +03:00
Jordan Schidlowsky
043b6c2d93 make 2d constraint solving more deterministic by solving in push order 2020-12-04 22:23:12 -06:00
Aaron Franke
5dddf4377a
Rename RD texture "type" to "texture_type"
"type" isn't very descriptive for exposed code, and this variable is exposed via RD_SETGET.
2020-12-04 19:34:50 -05:00
Aaron Franke
19bdd01438
Rename RD uniform "type" to "uniform_type"
"type" isn't very descriptive for exposed code, and this variable is exposed via RD_SETGET.
2020-12-04 19:34:50 -05:00
Aaron Franke
888deca827
Rename XR get_type and get_name
Now called get_tracker_type and get_tracker_name
2020-12-04 18:59:02 -05:00
Rémi Verschelde
14660ee399
Merge pull request #44080 from akien-mga/doc-sync
doc: Sync classref with current source
2020-12-05 00:50:29 +01:00
reduz
2787ad65be RenderingServer reorganization 2020-12-04 18:39:46 -03:00
Rémi Verschelde
1a001ad964
doc: Sync classref with current source
And fixups:
- Add missing bindings in RenderingServer
- Remove duplicate ArrayMesh enum bindings (they're in Mesh already)
- Remove redundant _unhandled_key_input binding in Control (it's in Node
  already)
2020-12-04 22:28:08 +01:00
Rémi Verschelde
1287ea63c1
Merge pull request #44084 from vnen/float-is-real
Rename TYPE_REAL to TYPE_FLOAT
2020-12-04 14:26:22 +01:00
George Marques
02f60812ed
Rename TYPE_REAL to TYPE_FLOAT
To be consistent with the naming everywhere else.
2020-12-04 09:47:26 -03:00
reduz
e93b2242c2 Reorganize rendering server.
-Made RenderingServerScene abstract, allowing reimplementation
-RenderingServerRaster -> RenderingServerDefault, but this class is going away soon.
2020-12-03 19:01:01 -03:00
reduz
70f5972905 Refactored Mesh internals and formats.
-Changed how mesh data is organized, hoping to make it more efficient on Vulkan and GLES.
-Removed compression, it now always uses the most efficient format.
-Added support for custom arrays (up to 8 custom formats)
-Added support for 8 weights in skeleton data.
-Added a simple optional versioning system for imported assets, to reimport if binary is newer
-Fixes #43979 (I needed to test)

WARNING:

-NOT backwards compatible with previous 4.x-devel, will most likely never be, but it will force reimport scenes due to version change.
-NOT backwards compatible with 3.x scenes, this will be eventually re-added.
-Skeletons not working any longer, will fix in next PR.
2020-12-02 13:07:59 -03:00
Yuri Roubinsky
d980278d81 Fixed crash in canvas_item_add_polyline if color arr has incorrect size 2020-11-30 11:05:55 +03:00
Rémi Verschelde
ef2d1f6d19
Merge pull request #42761 from fire/color-grading-3d
Environment brightness, contrast, saturation restore with 3d LUT.
2020-11-28 23:07:52 +01:00
clayjohn
076908bed9 Environment brightness, contrast, saturation restore with color correction.
Allow gradients and 2d images.

Use shader versions for LUT in tonemap

Co-authored-by: alex-poe <3957610+CptPotato@users.noreply.github.com>
Co-authored-by: QbieShay <cislaghi.ilaria@gmail.com>
Co-authored-by: Clay John <claynjohn@gmail.com>
2020-11-28 07:37:49 -08:00
Yuri Roubinsky
4a3588a51a
Merge pull request #43828 from Chaosus/restore_line_antialiasing
Restored antialiased lines by emulation using triangle strips
2020-11-28 11:32:16 +03:00
Rémi Verschelde
94341ac547
Merge pull request #42987 from clayjohn/VULKAN-sky-only
Add sky_only setting to DirectionalLight3Ds
2020-11-28 09:07:09 +01:00
Rémi Verschelde
a6751e6c58
Merge pull request #41100 from bruvzg/ctl_text_server_interface
[Complex Text Layouts] Implement TextServer interface.
2020-11-28 09:03:15 +01:00
Yuri Roubinsky
3ec972fc95 Restored antialiased lines by emulation using triangle strips 2020-11-27 20:45:59 +03:00
reduz
1bcf3c305b Implement signed distance fields for 2D shaders 2020-11-26 10:49:50 -03:00
bruvzg
493da99269
[Complex Text Layouts] Implement TextServer interface. Implement Fallback TextServer. 2020-11-26 13:55:26 +02:00
Jordan Schidlowsky
8150f07a0b fix for two incorrectly bound texture formats 2020-11-19 14:20:29 -06:00
Nick Swoboda
bce3e2c3f6 Check uniform set validity before freeing 2020-11-18 16:53:11 -08:00
Aaron Franke
02161aad5a
Remove empty lines around braces with the formatting script 2020-11-16 23:38:11 -05:00
Rémi Verschelde
d7176e9040
Merge pull request #42167 from madmiraal/fix-42108
Remove the unnecessary sync() and the restrictions it imposes on 3D Physics.
2020-11-16 09:32:48 +01:00
Rémi Verschelde
a78d96086f
Fix new transform to pixel snapping logic
Co-authored-by: lawnjelly <lawnjelly@gmail.com>
2020-11-15 10:52:15 +01:00
Rafał Mikrut
925ae37d8d Remove Attempted to free invalid ID error 2020-11-10 14:22:41 +01:00
Rémi Verschelde
dd851d8f91
Merge pull request #43333 from YeldhamDev/global_rate_scale_min
Disallow setting the AudioServer's 'global_rate_scale' to a value equal or inferior to 0
2020-11-10 09:32:56 +01:00
Rémi Verschelde
9d2e8f2f27
Variant: Rename Type::_RID to Type::RID
The underscore prefix was used to avoid the conflict between the `RID` class
name and the matching enum value in `Variant::Type`.

This can be fixed differently by prefixing uses of the `RID` class in `Variant`
with the scope resolution operator, as done already for `AABB`.
2020-11-09 16:29:04 +01:00
reduz
127458ed17 Reorganized core/ directory, it was too fatty already
-Removed FuncRef, since Callable makes it obsolete
-Removed int_types.h as its obsolete in c++11+
-Changed color names code
2020-11-07 20:17:12 -03:00
Hugo Locurcio
7b8fd6ba9e
Fix "unifom" typo in RasterizerStorageRD method 2020-11-06 18:12:00 +01:00
Michael Alexsander
d7f2c31a05 Disallow setting the AudioServer's 'global_rate_scale' to a value equal or inferior to 0 2020-11-05 08:44:53 -03:00
Rémi Verschelde
424cd00f8b
doc: Sync classref with current source + fixup some bindings
Includes various changes triggered by the refactoring of method bindings.
2020-11-04 15:38:26 +01:00
reduz
f123981a96 Implement DirectionalLight2D
Also separated Light2D in PointLight2D and DirectionalLight2D.
Used PointLight2D because its more of a point, and it does not work
the same as OmniLight (as shape depends on texture).
Added a few utility methods to Rect2D I needed.
2020-11-04 10:03:01 -03:00
Marios Staikopoulos
e5d7c7d5fc Alpha Hash and Alpha2Coverage Implementation 2020-11-02 20:11:20 -08:00
reduz
0e6664539d Refactor pixel snapping.
-Rename pixel_snap to snap_2d_to_vertices
-Added snap_2d_to_transforms which is more useful

Fixes #41814
Solves proposal https://github.com/godotengine/godot-proposals/issues/1666
Supersedes #35606, supersedes #41535, supersedes #41534
2020-10-30 08:57:32 -03:00
reduz
8ab9b39707 Implement CanvasGroup and CanvasItem clipping
-Allows merging several 2D objects into a single draw operation
-Use current node to clip children nodes
-Further fixes to Vulkan barriers
-Changed font texture generation to white, fixes dark eges when blurred
-Other small misc fixes to backbuffer code.
2020-10-28 18:53:32 -03:00
Rémi Verschelde
6c173e2f7f
Merge pull request #43058 from clayjohn/VULKAN-FXAA-bug
[4.0]Remove extra exposure multiply in FXAA
2020-10-25 00:35:12 +02:00
clayjohn
8e3e9e3755 Remove extra exposure multiply in FXAA 2020-10-24 13:00:39 -07:00
reduz
84d734da0e Refactored 2D shader and lighting system
-Removed normal/specular properties from nodes
-Create CanvasTexture, which can contain normal/specular channels
-Refactored, optimized and simplified 2D shaders
-Use atlas for light textures.
-Use a shadow atlas for shadow textures.
-Use both items aboves to make light rendering stateless (faster).
-Reorganized uniform sets for more efficiency.
2020-10-24 15:57:25 -03:00
Rémi Verschelde
d05c7da1aa
Merge pull request #42949 from DavidSichma/shaderglobals
Shader globals bugfixes
2020-10-22 09:53:49 +02:00
clayjohn
6299575250 Add sky_only setting to DirectionalLight3Ds 2020-10-21 23:28:08 -07:00
Yuri Roubinsky
433183147e Fix textureSize & texelFetch shader compilation errors 2020-10-21 17:45:40 +03:00
David Sichma
5d33cd94c8 Shader globals bugfixes
- shader globals editor displays properties correctly
- fixed some errors how globals were transferred
2020-10-21 01:34:25 +02:00
Hugo Locurcio
195540ab90
Remove unused #define from the tonemap shader
It was a leftover from an earlier version of the debanding PR
which used a simpler (but less effective) algorithm.
2020-10-20 19:59:50 +02:00
Rémi Verschelde
7d4921db1a
Merge pull request #42915 from Yetizone/negative_lights_behavior
tonemap.glsl: Ensure color parameter of tonemap_reinhard() is positive
2020-10-19 23:50:49 +02:00
Rémi Verschelde
cf3a4cb091
Merge pull request #42913 from Calinou/debanding-fix-brightness
Fix debanding slightly brightening the whole viewport
2020-10-19 23:18:24 +02:00
Yetizone
ffc4151f29 tonemap.glsl: Ensure color parameter of tonemap_reinhard() is positive
Color values can become negative in the case of negative lights which
leads to undesired behaviour.
2020-10-20 00:08:44 +03:00
Hugo Locurcio
15d033e25f
Fix debanding slightly brightening the whole viewport
Thanks to Mikkel Gjoel on Twitter for the tip :)
2020-10-19 22:53:28 +02:00
reduz
dd0b097e44 Fix invalid buffer updates in SDFGI 2020-10-19 17:39:09 -03:00
Rémi Verschelde
7480a7d178
Fixup method binding from #42910 2020-10-19 22:23:36 +02:00
Juan Linietsky
5d120f9ffb
Merge pull request #42046 from Chaosus/fix_default_texture
Fix setting the default texture to shader
2020-10-19 15:50:21 -03:00
Juan Linietsky
85ebf40b6c
Merge pull request #38097 from Calinou/add-viewport-debanding
Add a debanding property to Viewport
2020-10-19 14:15:44 -03:00
Juan Linietsky
53d5a252bb
Revert "Replace SAO implementation with MSSAO" 2020-10-18 19:27:51 -03:00
Juan Linietsky
d98261ab8f
Merge pull request #42077 from clayjohn/MSSAO
Replace SAO implementation with MSSAO
2020-10-18 18:34:43 -03:00
Juan Linietsky
6e5f137c01
Merge pull request #41415 from clayjohn/VULKAN-shader-overrides
Add FOG, RADIANCE, and IRRADIANCE shader overrides
2020-10-18 18:33:41 -03:00
Juan Linietsky
e799a2ba45
Merge pull request #42201 from clayjohn/Vulkan-new-glow
Optimize Glow with local memory
2020-10-18 18:32:36 -03:00
clayjohn
366ee46774 Replace SAO implementation with MSSAO 2020-10-18 13:15:51 -07:00
clayjohn
f46932feab Add FOG, RADIANCE, and IRRADIANCE shader overrides 2020-10-18 12:06:51 -07:00
Yuri Roubinsky
d0f85b9321 Fix setting the default texture to shader 2020-10-18 21:59:37 +03:00
clayjohn
63a34b93aa Optimize Glow with local memory 2020-10-18 11:37:12 -07:00
Juan Linietsky
4467412c9f
Merge pull request #38949 from puchik/ssr-fix-cutoff
Continue tracing screen space reflection after encountering sky
2020-10-18 14:45:33 -03:00
Rémi Verschelde
d9e5c355e5
Merge pull request #41418 from clayjohn/Vulkan-aerial
Add aerial perspective to fixed fog
2020-10-18 17:32:19 +02:00
reduz
ee06a70ea6 Refactor MethodBind to use variadic templates
Removed make_binders and the old style generated binders.
2020-10-18 12:28:44 +02:00
clayjohn
8c21c26fb5 Add aerial perspective to fixed fog 2020-10-17 10:53:07 -07:00
Hugo Locurcio
4357506e64
Fix "fixed" fog drawing in front of volumetric fog with a sky background
This closes #42820.

Co-authored-by: Clay John <claynjohn@gmail.com>
2020-10-15 21:59:08 +02:00
Rémi Verschelde
e927f54170
Merge pull request #42804 from RandomShaper/fix_fft_window
Fix application of window in FFT
2020-10-15 13:21:33 +02:00
Hugo Locurcio
b44de3c6b1
Fix typo in soft shadow quality project settings hints 2020-10-15 10:31:35 +02:00
Pedro J. Estébanez
257ba4a7fb Fix application of window in FFT 2020-10-15 01:57:17 +02:00
Yuri Roubinsky
1dbfd4c3e8
Merge pull request #42763 from Chaosus/shader_emit_autocompletion
Fix autocompletion for emit_particle in shader editor
2020-10-13 16:01:37 +03:00
Yuri Roubinsky
6914597026 FIx autocompletion for emit_particle in shader editor 2020-10-13 14:12:51 +03:00
Rafał Mikrut
84a1817a75 Fixes leaks with shader and material 2020-10-12 18:06:47 +02:00
Rémi Verschelde
d22791c271
doc: Sync classref with current source 2020-10-12 10:58:02 +02:00
unknown
1d3aec4230 Free a SortShader and a ParticlesCopyShader 2020-10-12 13:25:24 +05:30
reduz
26f5bd245c Implement GPU Particle Collisions
-Sphere Attractor
-Box Attractor
-Vector Field
-Sphere Collider
-Box Collider
-Baked SDF Collider
-Heightmap Collider
2020-10-09 13:25:47 -03:00
Rémi Verschelde
e9ff08692c
Merge pull request #42548 from pezcode/lights-metallic
Add METALLIC to light() built-ins
2020-10-09 14:41:53 +02:00
clayjohn
bde2f9b46b Return proper texture view format for decals 2020-10-03 22:56:00 -07:00