summaryrefslogtreecommitdiffstats
path: root/modules/lightmapper_rd/lightmapper_rd.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Finish splitting functionality of the Vulkan and D3D12 backends into ↵Dario2024-02-121-2/+52
| | | | RenderingDeviceDriver.
* Replace error checks against `size` with `is_empty`A Thousand Ships2024-02-091-2/+2
|
* Add GLES3 infrastructure for lightmap baking in the compatibility backendclayjohn2024-01-241-1/+1
|
* Promote CowData to 64 bitsJuan Linietsky2024-01-191-1/+1
| | | | Fixes a lot of bugs, please help me fill the list.
* Acyclic Command Graph for RenderingDevice.Dario2024-01-081-2/+2
| | | | Adds a new system to automatically reorder commands, perform layout transitions and insert synchronization barriers based on the commands issued to RenderingDevice.
* Merge pull request #86555 from RandomShaper/fix_warnRémi Verschelde2024-01-041-1/+1
|\ | | | | | | Fix LightmapperRD division warning in MSVC
| * Fix warning in MSVCPedro J. Estébanez2023-12-271-1/+1
| |
* | Fix potential integer underflow in rounded up divisionsEddieBreeg2024-01-021-11/+11
|/ | | | | | | | | | 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>
* Don't use TTR/RTR for ERR/WARN printsRémi Verschelde2023-11-121-2/+2
| | | | We don't translate those, only editor strings are translated.
* Optimize lightmapper using triangle clusters on the acceleration structure.Dario2023-10-131-26/+148
| | | | 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.
* Rewrite the GPU Lightmapper's indirect lighting logic to match Godot 3.5's ↵Dario2023-10-131-156/+134
| | | | | | 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.
* Re-add optional OIDN denoise as an external executable.bruvzg2023-10-111-2/+154
|
* Make the lightmapper not dilate before denoising.Dario2023-09-291-14/+6
| | | | Dilating noisy data caused issues for the denoiser. Fixes #82526.
* Replace OIDN denoiser with a JNLM denoiser compute shader implementation.Dario2023-09-251-37/+95
|
* Add half-pixel offset to lightmapper rasterization.Dario2023-09-181-6/+10
| | | | 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.
* Style: Harmonize header includes in modulesRémi Verschelde2023-06-151-2/+3
| | | | | | | | | | | | | | | | | | | | 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
* One Copyright Update to rule them allRémi Verschelde2023-01-051-29/+29
| | | | | | | | | | | | | | | | | | | | 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".
* Make some Image methods statickobewi2022-10-141-41/+15
|
* Fix MSVC warnings, rename shadowed variables, fix uninitialized values, ↵bruvzg2022-10-071-4/+4
| | | | change warnings=all to use /W4.
* Implement Physical Light Units as an optional setting.clayjohn2022-08-311-1/+5
| | | | | | 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.
* Rename `str2var` to `str_to_var` and similarMicky2022-08-261-2/+2
| | | | | | | | | | | | | | | | | | 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`
* Use integer types in Image and ImageTexture methodsFireForge2022-07-181-3/+3
| | | | | | | | | | | - Image.blit_rect() - Image.blit_rect_mask() - Image.blend_rect() - Image.blend_rect_mask() - Image.fill_rect() - Image.get_used_rect() - Image.get_rect() - ImageTexture.set_size_override()
* add support for soft shadows to the lightmapperPriyansh Rathi2022-06-241-21/+24
|
* Rename Basis "elements" to "rows"Aaron Franke2022-04-291-9/+9
|
* String: Remove TTR and DTR defines in non-tools buildRémi Verschelde2022-03-281-14/+15
| | | | | This ensures we don't use TTR in runtime code, as it's specifically meant to source translations for the editor.
* Change some math macros to constexprkobewi2022-03-091-2/+2
| | | | Changes `MAX`, `MIN`, `ABS`, `CLAMP` and `SIGN`.
* Add a UniformSet cachereduz2022-03-061-34/+34
| | | | | | | * Changed syntax usage for RD::Uniform to create faster with a single RID * Converted render pass setup to use this in clustered renderer to test. This is the first step into creating a proper uniform set cache system to simplify large parts of the codebase.
* Use fill() to fill an entire image instead of setting pixels individually.Anilforextra2022-01-081-5/+1
|
* Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
| | | | Happy new year to the wonderful Godot community!
* GPULightmapper: execute dilate also after denoiseWilliam Deurwaarder2021-10-161-0/+8
| | | | | | Dilate fills gaps that are caused by the rasterization. As dilate is based on the alpha-channel which is not part of denoise, dilate can be run after denoise as well. So that colors are not denoised/mixed over seams.
* GPULightmapper: execute dilate before denoiseWilliam Deurwaarder2021-10-161-60/+64
| | | | | | | | | Dilate fills gaps that are caused by the rasterization. Previously denoise was done before dilate which caused the gaps to become filled (non-zero). This resulted that the gaps were not recognized by dilate and the background color leaked. This is fixed by executing dilate before denoise.
* GPULightmapper's triangles and their bounding box will be in-syncWilliam Deurwaarder2021-09-111-32/+16
| | | | | | | | | | Previously the bounding boxes and triangles were maintained in two separate arrays (Vectors). As the triangle vector was sorted and the bounding-box array was not , the order of both arrays differed. This meant that the index in one was different than the other, which caused lookup issues. To prevent this, the bounding-box is now part of the triangle structure so that there is a single structure that cannot become out-of-sync anymore.
* Implement Binary Shader Compilationreduz2021-07-261-8/+8
| | | | | | | | | | * Added an extra stage before compiling shader, which is generating a binary blob. * On Vulkan, this allows caching the SPIRV reflection information, which is expensive to parse. * On other (future) RenderingDevices, it allows caching converted binary data, such as DXIL or MSL. This PR makes the shader cache include the reflection information, hence editor startup times are significantly improved. I tested this well and it appears to work, and I added a lot of consistency checks, but because it includes writing and reading binary information, rare bugs may pop up, so be aware. There was not much of a choice for storing the reflection information, given shaders can be a lot, take a lot of space and take time to parse.
* Rename `instance()`->`instantiate()` when it's a verbLightning_A2021-06-191-17/+17
|
* Assorted fixes to UV unwrapping and GPU lightmapperjfons2021-05-031-49/+37
| | | | | | | | | | | | | | | | | | | | Various fixes to UV2 unwrapping and the GPU lightmapper. Listed here for context in case of git blame/bisect: * Fix UV2 unwrapping on import, also cleaned up the unwrap cache code. * Fix saving of RGBA images in EXR format. * Fixes to the GPU lightmapper: - Added padding between atlas elements, avoids bleeding. - Remove old SDF generation code. - Fix baked attenuation for Omni/Spot lights. - Fix baking of material properties onto UV2 (wireframe was wrongly used before). - Disable statically baked lights for objects that have a lightmap texture to avoid applying the same light twice. - Fix lightmap pairing in RendererSceneCull. - Fix UV2 array generated from `RenderingServer::mesh_surface_get_arrays()`. - Port autoexposure fix for OIDN from 3.x. - Save debug textures as EXR when using floating point format.
* Core: Drop custom `copymem`/`zeromem` definesRémi Verschelde2021-04-271-4/+4
| | | | | | | | We've been using standard C library functions `memcpy`/`memset` for these since 2016 with 67f65f66391327b2967a20a89c3627e1dd6e84eb. There was still the possibility for third-party platform ports to override the definitions with a custom header, but this doesn't seem useful anymore.
* Reorganize Project Settingsreduz2021-02-181-11/+11
| | | | | | | -Advanced Settings toggle also hides advanced properties when disabled -Simplified Advanced Bar (errors were just plain redundant) -Reorganized rendering quality settings. -Reorganized miscelaneous settings for clean up.
* Invert spotlight angle attenuationjfons2021-02-071-2/+2
| | | | | | | | | | Inverted the spotlight angle attenuation so a higher value results in a dimmer light, this makes it more consistent with the distance attenuation. Also changed the way spotlighs are computed in SDFGI and GIPorbes and GPU lightmapper, now it matches the falloff used in the scene rendering code.
* Reorganize RenderingDevice barriersreduz2021-01-261-2/+2
| | | | | | | -Removed sync to draw, now everything syncs to draw by default. -Fixed many validation layer errors. -Added support for VkImageViewUsageCreateInfo to fix validation layer warnings. -Texture, buffer, raster and compute functions now all allow spcifying which barriers will be used.
* Update copyright statements to 2021Rémi Verschelde2021-01-011-2/+2
| | | | | | | | | | | | | | Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
* Rename empty() to is_empty()Marcel Admiraal2020-12-281-2/+2
|
* Static analyzer fixes:bruvzg2020-12-091-1/+0
| | | | | | Removes unused code in OS. Fixes return types. Fixes few typos.
* Rename RD texture "type" to "texture_type"Aaron Franke2020-12-041-3/+3
| | | "type" isn't very descriptive for exposed code, and this variable is exposed via RD_SETGET.
* Rename RD uniform "type" to "uniform_type"Aaron Franke2020-12-041-34/+34
| | | "type" isn't very descriptive for exposed code, and this variable is exposed via RD_SETGET.
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-1/+1
| | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* Split `Geometry` singleton into `Geometry2D` and `Geometry3D`Andrii Doroshenko (Xrayez)2020-05-271-6/+6
| | | | Extra `_2d` suffixes are removed from 2D methods accoringly.
* Style: Enforce separation line between function definitionsRémi Verschelde2020-05-141-0/+7
| | | | | | | | | | | | | | | | | | | | | | | I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-39/+0
| | | | | | | | | | | | | | Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
* Style: Fix missing/invalid copyright headersRémi Verschelde2020-05-141-0/+30
|
* New lightmapperJuan Linietsky2020-05-101-0/+1754
-Added LocalVector (needed it) -Added stb_rect_pack (It's pretty cool, we could probably use it for other stuff too) -Fixes and changes all around the place -Added library for 128 bits fixed point (required for Delaunay3D)