Commit Graph

79 Commits

Author SHA1 Message Date
9fbf5808a0 Rename server "free" functions to "free_rid" to match exposed API 2025-09-30 16:52:25 -07:00
f11aff3841 Editor: Restructure editor code
Moving various editor files into sub folders to reduce clutter
2025-07-04 18:18:22 +02:00
b16b3ea383 Fix buffer size calculations in lightmapper_rd.cpp to account for element sizes 2025-06-21 21:20:56 -04:00
2b36c79f7b Use Span<uint8_t> in RenderingDevice allocation APIs to avoid intermediary arrays on calls. 2025-06-18 12:31:48 +02:00
219035c5ea Fix LightmapGI shadow leaks 2025-06-08 20:13:12 +04:00
6434c3d2c4 LightmapGI: Search for shadowmask light index only after sorting the lights 2025-06-05 15:55:48 +02:00
4f4031a675 Replace size() == 0 with is_empty(). 2025-04-02 19:18:43 +08:00
7ed64ebd9a Lightmapper: Expose the JNLM denoiser region size in the project settings 2025-02-13 12:00:51 +01:00
49a004fc13 Spread direct lighting calculation for LightmapGI over several submissions to avoid TDR on Windows devices
Also add percentage progress for direct lighting step
2025-01-31 16:37:13 -08:00
054340bb6b Add a supersampling option to LightmapGI
This provides increased lightmap quality with less noise, smoother
shadows and better small-scale shadow detail. The downside is that
this significantly increases bake times and memory usage while baking
lightmaps, so this option is disabled by default.

Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
Co-authored-by: landervr <31851431+CpnWaffle@users.noreply.github.com>
2025-01-07 18:44:59 +01:00
3cc5f6e346 Remove leftover print in lightmapper_rd.cpp 2024-12-23 21:14:14 +01:00
a3525bc015 Add transparency support for LightmapGI
Co-authored-by: Guerro323 <kaltobattle@gmail.com>
2024-12-18 19:36:16 +01:00
189c8eb671 Implement shadowmasks for LightmapGI
Co-authored-by: dearthdev <nathandearthdev@gmail.com>
2024-12-12 11:00:28 +01:00
6d5ac8f7ef Resolve load and store ops automatically for render passes for discardable textures. 2024-11-25 11:27:48 -03:00
5bca028e2b Add lightmap bake cancelling 2024-11-21 21:31:02 +02:00
a89f4fa5a9 LightmapGI: Pack L1 SH coefficients for directional lightmaps 2024-09-05 22:46:58 +02:00
a7a245de92 Metal: enable for betsy and lightmapper modules
To support this, the rendering_context_driver_metal.h header was updated
to recognise when it is included in non-Objective-C source files.
2024-08-31 08:29:07 +10:00
e98aaf1caa Merge pull request #94477 from RedMser/typos-batch-1
Fix various typos
2024-08-28 00:12:12 +02:00
68d188d521 Merge pull request #95888 from clayjohn/Lightmap-SH-coefficients
Use correct lightmap coefficients to ensure that the directional lightmap mode looks correct
2024-08-25 20:18:18 +02:00
364f916f3f Add debug utilities for Vulkan
Features:
- Debug-only tracking of objects by type. See
get_driver_allocs_by_object_type et al.
 - Debug-only Breadcrumb info for debugging GPU crashes and device lost
 - Performance report per frame from get_perf_report
- Some VMA calls had to be modified in order to insert the necessary
memory callbacks

Functionality marked as "debug-only" is only available in debug or dev
builds.

Misc fixes:
 - Early break optimization in RenderingDevice::uniform_set_create

============================

The work was performed by collaboration of TheForge and Google. I am
merely splitting it up into smaller PRs and cleaning it up.
2024-08-21 23:48:08 +02:00
f4ccba7508 Use correct lightmap coefficients to ensure that the directional lightmap mode looks correct
Also remove the metallic option from directional lightmap as it is guaranteed to return negative numbers in many cases
2024-08-21 10:24:32 -07:00
1521e49c23 Antialias direct light samples in LightmapperRD
Additionally use Vogel disk to enhance soft shadow quality.
2024-08-19 17:54:55 -07:00
f9258ff928 Fix typos 2024-07-17 18:53:03 +02:00
60a255a0d0 Lightmapper: Prevent infinite loop when blitting lightmaps into an atlas 2024-07-13 13:10:04 +02:00
14877d1f99 Lightmapper: Ensure the atlas is big enough to fit padded UV maps 2024-07-11 23:16:31 +02:00
d06bce3002 Fix lightmapper seam blending 2024-05-15 19:30:14 +04:00
e7bd1b0673 Add denoiser range property for LightmapGI 2024-05-15 08:26:04 +02:00
f1b758022a LightmapGI: Fix seam blending with directional lightmaps 2024-04-18 14:21:29 +02:00
79ba22a73f Use Vector* component-wise min/max/clamp functions where applicable 2024-03-20 13:47:42 +01:00
73eff10c76 Finish splitting functionality of the Vulkan and D3D12 backends into RenderingDeviceDriver. 2024-02-12 10:02:18 -03:00
684752e75b Replace error checks against size with is_empty 2024-02-09 12:50:15 +01:00
efb1cbaad4 Add GLES3 infrastructure for lightmap baking in the compatibility backend 2024-01-24 17:13:30 -08:00
24fe0715b5 Promote CowData to 64 bits
Fixes a lot of bugs, please help me fill the list.
2024-01-19 17:41:10 +01:00
cc4d39b0c1 Acyclic Command Graph for RenderingDevice.
Adds a new system to automatically reorder commands, perform layout transitions and insert synchronization barriers based on the commands issued to RenderingDevice.
2024-01-08 14:54:56 -03:00
2a4eaa4cd8 Merge pull request #86555 from RandomShaper/fix_warn
Fix LightmapperRD division warning in MSVC
2024-01-04 14:26:20 +01:00
8747c67d9e Fix potential integer underflow in rounded up divisions
A new `Math::division_round_up()` function was added, allowing for easy
and correct computation of integer divisions when the result needs to
be rounded up.

Fixes #80358.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2024-01-02 14:14:47 +01:00
fe8c217b7c Fix warning in MSVC 2023-12-27 17:50:45 +01:00
15b8185c68 Don't use TTR/RTR for ERR/WARN prints
We don't translate those, only editor strings are translated.
2023-11-12 12:00:55 +01:00
47214ea9f5 Optimize lightmapper using triangle clusters on the acceleration structure.
Add an additional layer of indirection to the grid used by the lightmapper to store fixed-size triangle clusters. Greatly speeds up baking times on scenes with high triangle density, as the clusters will help to avoid unnecessary checks when the triangle density is high on the scene.
2023-10-13 17:57:25 -03:00
a9a197d2dc Rewrite the GPU Lightmapper's indirect lighting logic to match Godot 3.5's CPU Lightmapper.
Port over the logic from Godot 3.5 for indirect lighting. This should fix many issues about indirect bounces causing more energy and improve the overall quality of the result.
2023-10-13 14:33:55 -03:00
899e56de5d Re-add optional OIDN denoise as an external executable. 2023-10-11 19:52:18 +03:00
ac90ca714c Make the lightmapper not dilate before denoising.
Dilating noisy data caused issues for the denoiser. Fixes #82526.
2023-09-29 12:36:36 -03:00
1b2b726502 Replace OIDN denoiser with a JNLM denoiser compute shader implementation. 2023-09-25 14:53:45 -03:00
ddc3126bbf Add half-pixel offset to lightmapper rasterization.
Add half-pixel offset to lightmapper to fix issues where the ray would be generated from the wrong spot corresponding to the pixel and causing light leaks. Fixes Issue #69126.
2023-09-18 11:56:04 -03:00
25b2f1780a Style: Harmonize header includes in modules
This applies our existing style guide, and adds a new rule to that style
guide for modular components such as platform ports and modules:

Includes from the platform port or module ("local" includes) should be listed
first in their own block using relative paths, before Godot's "core" includes
which use "absolute" (project folder relative) paths, and finally thirdparty
includes.

Includes in `#ifdef`s come after their relevant section, i.e. the overall
structure is:

- Local includes
  * Conditional local includes
- Core includes
  * Conditional core includes
- Thirdparty includes
  * Conditional thirdparty includes
2023-06-15 14:35:45 +02:00
d95794ec8a One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +01:00
072f6feaba Make some Image methods static 2022-10-14 14:34:15 +02:00
0103af1ddd Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4. 2022-10-07 11:32:33 +03:00
385ee5c70b Implement Physical Light Units as an optional setting.
This allows light sources to be specified in physical light units in addition to the regular energy multiplier. In order to avoid loss of precision at high values, brightness values are premultiplied by an exposure normalization value.

In support of Physical Light Units this PR also renames CameraEffects to CameraAttributes.
2022-08-31 12:14:46 -07:00
59e11934d8 Rename str2var to str_to_var and similar
Affects the Math class, a good chunk of the audio code, and a lot of other miscellaneous classes, too.

- `var2str` -> `var_to_str`
- `str2var` -> `str_to_var`
- `bytes2var` -> `bytes_to_var`
- `bytes2var_with_objects` -> `bytes_to_var_with_objects`
- `var2bytes` -> `var_to_bytes`
- `var2bytes_with_objects` -> `var_to_bytes_with_objects`
- `linear2db` -> `linear_to_db`
- `db2linear` -> `db_to_linear`
- `deg2rad` -> `deg_to_rad`
- `rad2deg` -> `rad_to_deg`

- `dict2inst` -> `dict_to_inst`
- `inst2dict` -> `inst_to_dict`
2022-08-26 14:58:22 +02:00