Commit Graph

3289 Commits (cb1569345a6f17da08241e645ab03cb2e1b78d2f)

Author SHA1 Message Date
Thaddeus Crews da593d0c16
Merge pull request #111897 from allenwp/environment-adj-prioritize-old-behaviour
Improve `Environment` adjustments (favor old behavior and quality).
2025-10-23 11:03:56 +07:00
Clay John bad8f531a8 Sync final frame after finalizing RD to ensure that nothing is in use on the GPU when we free the RD 2025-10-23 08:20:54 +07:00
Allen Pestaluky 0c7f013c55 Improve `Environment` color adjustments; specifically brightness and HDR 2D contrast.
This commit changes adjustments to behave as follows for all rendering configurations:

- Apply brightness to linear-encoded values, preventing contrast, saturation, and hue from being affected.
- Apply contrast to perceptually uniform (nonlinear sRGB-encoded) values, matching existing behavior when HDR 2D is disabled and producing optimal visual quality.
- Apply saturation with even color channel weights. This causes brightness of certain colors to change, but matches existing behavior when HDR 2D is disabled.

Adjustments are applied after glow and tonemapping to match existing behavior.
2025-10-23 11:08:49 +07:00
Thaddeus Crews 3f34e38703
Merge pull request #109596 from atlasapplications/splash-screen-stretch-mode
Add Stretch Modes for Splash Screen
2025-10-21 19:09:33 +07:00
Justin Sasso b6b3e1ef9e Add Stretch Modes for Splash Screen
Co-authored-by: Samuel Pedrajas <samuelpedrajaspz@gmail.com>
2025-10-21 18:20:44 +07:00
clayjohn f61ee7bdf6 Use half float precision buffer for 3D when HDR2D is enabled
This is necessary for Environment effects like Glow to work correctly.
2025-10-21 13:44:46 +07:00
Thaddeus Crews da3bdacf64
Merge pull request #111210 from blueskythlikesclouds/ssr-overhaul
Overhaul screen space reflections.
2025-10-21 15:11:08 +07:00
Skyth c128886c63 Overhaul screen space reflections. 2025-10-21 19:23:38 +07:00
Erik Ritschl 44451e6988 Fix incorrect failure code in screen_get_framebuffer_format
RenderingDevice::screen_get_framebuffer_format should return a value of
type RenderingDevice::FramebufferFormatID which is an alias of int64_t
but it returns Error::FAILED with a value of 1. The compiler does not
complain because both types are integers but 1 corresponds to a valid
FramebufferFormatID, meaning a certain failure condition is missed.

This commit changes it to the correct value, INVALID_ID.
2025-10-21 15:26:26 +07:00
Ben Botwin 7613123048 fixes the lods array returned by mesh_get_surface 2025-10-16 17:26:48 +07:00
Dario af584b1ba8 Do not begin a new frame during RenderingDevice's shutdown. 2025-10-16 13:47:18 +07:00
Thaddeus Crews 71031e4adb
Merge pull request #108422 from stuartcarnie/108115_metal_cpu_read_bit
Metal: Fix `texture_get_data` other linear formats
2025-10-15 16:31:02 +07:00
Stuart Carnie a281e91c5a Metal: Fix `texture_get_data` other linear formats
Introduce a specialised `texture_get_data` for `RenderDeviceDriver`,
which can retrieve the texture data from the GPU driver for shared
textures (`TEXTURE_USAGE_CPU_READ_BIT`).

Closes #108115
2025-10-16 06:46:51 +07:00
Dario b49aea89d0 Organize render surface sorting key for optimizing API performance. 2025-10-15 11:35:02 +07:00
Clay John 36b92128b1
Merge pull request #110671 from allenwp/environment-glow-consistent
Blend glow before tonemapping and change default to screen.
2025-10-14 21:29:43 +07:00
Thaddeus Crews 1e9d0ff925
Merge pull request #111578 from Kaleb-Reid/fix-shadow-cull-material
Use correct shadow material in some cases in Mobile
2025-10-14 17:13:42 +07:00
Kaleb Reid 8a8bd02860 Use correct shadow material in some cases in Mobile 2025-10-14 13:44:09 +07:00
Thaddeus Crews 0400b703e4
Merge pull request #111577 from Kaleb-Reid/fix-lightmap-luminance
Apply luminance multiplier in copy_cubemap_to_panorama
2025-10-14 10:31:34 +07:00
Kaleb Reid 8173f43770 Apply luminance multiplier in copy_cubemap_to_panorama 2025-10-13 21:41:03 +07:00
Thaddeus Crews c0c75561d2
Merge pull request #111129 from DarioSamo/particle-pipeline-deferral
Push pipeline compilation of various effects to the worker thread pool.
2025-10-13 19:29:00 +07:00
Thaddeus Crews d3285f5468
Merge pull request #111185 from WhalesState/vp-disable-xr
More XR disable for Viewport and export.
2025-10-13 19:28:56 +07:00
Karl Office 7a49918c89 fix: set visible layers in multiview camera 2025-10-13 17:31:01 +07:00
Dario ba268416d5 Push pipeline compilation of various effects to the worker thread pool. 2025-10-13 12:00:23 +07:00
Allen Pestaluky cafc012b05 Blend `Environment` glow before tonemapping and change default blend mode to screen.
Additionally, change the minimum `tonemap_white` parameter to `1.0`; users can increase `tonemap_exposure` for a similar effect to decreasing `tonemap_white` below `1.0`.

Co-authored-by: Hei <40064911+Lielay9@users.noreply.github.com>
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2025-10-10 12:08:08 +07:00
Thaddeus Crews 8150cb9200
Merge pull request #111403 from AeioMuch/fix_double_precision_wrong_indexes
Fix wrong indices used for transform & UBO matrix for double precision build
2025-10-10 10:25:59 +07:00
AeioMuch dae2122388 Fix wrong indexes for double precision 2025-10-09 22:01:41 +07:00
Allen Pestaluky bd9d1bf070 Add material debanding for use in Mobile rendering method.
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2025-10-08 16:22:41 +07:00
lawnjelly 1c8ef479b4 FTI - Add `multimesh_instances_reset_physics_interpolation()` 2025-10-08 16:17:18 +07:00
Kaleb Reid f2d0ea6d40 Ensure reflection atlas is valid before rendering 2025-10-07 22:05:22 +07:00
Thaddeus Crews f457855148
Merge pull request #111227 from clayjohn/RD-scene-shader-crash
Fix scene shader crash due to rename of view matrix and inverse view matrix
2025-10-07 17:15:11 +07:00
Thaddeus Crews ef853bbc06
Merge pull request #111347 from Ivorforce/no-algorithm
Add `max()` to `Span`, replacing `<algorithm>` include from `rendering_device_commons.h`
2025-10-07 17:15:09 +07:00
clayjohn c7276273d8 Fix scene shader crash due to rename of view matrix and inverse view matrix 2025-10-07 13:36:23 +07:00
Lukas Tenbrink 1fa332cad4 Add `max()` to `Span`.
Remove `<algorithm>` include from `rendering_device_commons.h`, using `Span` instead.
2025-10-07 22:26:32 +07:00
Rémi Verschelde 9052d31c68
Merge pull request #111331 from Repiteo/scons/revert-cppextpath
Revert "SCons: Add `CPPEXTPATH` for external includes"
2025-10-07 13:07:19 +07:00
Thaddeus Crews fdc235f496
Merge pull request #110884 from Kaleb-Reid/fix-spotlight-aabb
Use correct AABB for SpotLight3Ds when `spot_angle > 90`
2025-10-06 14:34:05 +07:00
Thaddeus Crews b17aa3343a
Revert "SCons: Add `CPPEXTPATH` for external includes" 2025-10-06 13:09:22 +07:00
Mounir Tohami 9894256e3a More XR disable for Viewport and export. 2025-10-06 20:15:07 +07:00
Thaddeus Crews d1d28c0bcf
Merge pull request #111223 from Ivorforce/remove-iterator-include
Replace `std::size` usage with `std_size` to avoid `<iterator>` include.
2025-10-06 09:06:49 +07:00
Thaddeus Crews 9f4f16c588
Merge pull request #110672 from Kaleb-Reid/fallback-scaling-type
Use correct scaling type when falling back to bilinear
2025-10-06 09:06:39 +07:00
Thaddeus Crews f85dc0720d
Merge pull request #111303 from Kaleb-Reid/fix-dof-msaa-mobile
Use resolved depth texture for DOF with MSAA in Mobile
2025-10-06 09:06:38 +07:00
Thaddeus Crews 686b56fae9
Merge pull request #106434 from Ivorforce/invert-hashfuncs
Reduce cross project includes by rewriting `HashMapHasherDefault`.
2025-10-06 09:06:37 +07:00
Thaddeus Crews d364dacac1
Merge pull request #110004 from Kaleb-Reid/divide-luminance
Divide screen texture by luminance multiplier in compatibility
2025-10-06 09:06:33 +07:00
Thaddeus Crews 30a0a41982
Merge pull request #111274 from chocola-mint/include-optimization-logger
Remove `file_access.h` and `script_backtrace.h` includes from `logger.h`.
2025-10-06 09:06:32 +07:00
Rémi Verschelde 900bd07d10
Merge pull request #111125 from BlueCube3310/lightmap-sort-bitshift
Fix LightmapGI not being correctly applied to objects
2025-10-06 14:08:07 +07:00
Kaleb Reid ac8491ae72 Use resolved depth texture for DOF with MSAA in Mobile 2025-10-05 13:51:42 +07:00
Chaosus fe1447de0c Fix ternary expression for structs in shaders 2025-10-05 14:47:16 +07:00
chocola-mint ead282ff13 Remove `file_access.h` and `script_backtrace.h` includes from `logger.h`. 2025-10-05 17:49:23 +07:00
Lukas Tenbrink ad600125df Rewrite `HashMapHasherDefault` based on type traits - it is now possible to declare a default hashing function for any type.
Remove cross-project includes from `hashfuncs.h`.
Improve hashing function for `Color` (based on values instead of `String`).
Move `Variant` comparison from `hash_map.h` to `dictionary.cpp` (`VariantComparatorDictionary`), where it's used.
Remove now unnecessary `HashableHasher`.
2025-10-05 01:49:11 +07:00
Lukas Tenbrink 1db0a60dc0 Replace `std::size` usage with `std_size` to avoid `<iterator>` include. 2025-10-05 00:26:11 +07:00
Kaleb Reid 91167c3c23 Use correct AABB for SpotLight3Ds when spot_angle > 90 2025-10-04 02:12:51 +07:00
Kaleb Reid 8ad335eae0 Divide screen texture by luminance multiplier in compatibility 2025-10-04 00:19:42 +07:00
Thaddeus Crews 06827c91c6
Merge pull request #107839 from Rudolph-B/Occlusion-Culling-Optimization
Minor Optimization to Occlusion Culling
2025-10-03 12:01:13 +07:00
Thaddeus Crews fb572aff53
Merge pull request #107666 from Sch1nken/add-physics-interpolation-multimesh2d
Add MultiMesh physics interpolation for 2D transforms (MultiMeshInstance2D)
2025-10-03 12:01:07 +07:00
Thaddeus Crews 38af23a654
Merge pull request #89409 from aaronfranke/server-folders
Move server files into their subfolders
2025-10-03 12:01:00 +07:00
lawnjelly 594fd1da49 FTI - Optimize non-interpolated 2D items 2025-10-03 08:38:46 +07:00
Stuart Carnie 3ffcae66a8 Renderer: Fix missing shader_name; use forward declarations
* Moving over to RenderingShaderContainer, missed setting shader_name
* Use forward declaration reduces compile time when modifying
  rendering_shader_container.h from over 950s to about 10-15
2025-10-02 10:02:18 +07:00
Thaddeus Crews 4594de69fd
Merge pull request #111013 from stuartcarnie/shader_container_ext
Renderer: Move `reflect_spirv` to `RenderingShaderContainer`
2025-10-01 17:54:09 +07:00
BlueCube3310 24ed12d4a3 Fix LightmapGI not being correctly applied to objects 2025-10-01 19:18:09 +07:00
Aaron Franke 3d1c9fd5de
Move server files into their subfolders 2025-09-30 19:39:39 +07:00
Thaddeus Crews 2b7f39ea28
Merge pull request #110505 from Calinou/tweak-draw-command-labels
Tweak draw command label names for consistency
2025-09-30 20:10:37 +07:00
Aaron Franke 9fbf5808a0
Rename server "free" functions to "free_rid" to match exposed API 2025-09-30 16:52:25 +07:00
Thaddeus Crews f9694033a5
Merge pull request #107923 from clayjohn/RD-mat3x4
Use Mat3x4 for model and view transforms to save bandwidth and ALUs
2025-09-30 18:34:59 +07:00
Thaddeus Crews c28b6c2ced
Merge pull request #109186 from clayjohn/reflection-probe-size-update
Prompt editor restart when reflection probe size is updated
2025-09-30 18:34:57 +07:00
Thaddeus Crews 3997e77393
Merge pull request #111054 from Kaleb-Reid/fix-render-list
Sort render list correctly in RD renderers
2025-09-30 11:19:18 +07:00
Thaddeus Crews 21fd4faf1b
Merge pull request #107469 from Ivorforce/vector-localvector-explicit-span-conversions
Remove implicit conversions between `LocalVector` and `Vector`
2025-09-30 11:19:17 +07:00
clayjohn aa8bc0b56d Prompt editor restart when reflection probe size is updated
Also formally deprecate the RS function for updating an individual probes size. The functionality was removed in 4.0, but the function itself was mistakenly left exposed.
2025-09-29 18:35:34 +07:00
Kaleb Reid 5021b3e6e5 Sort render list correctly in RD renderers 2025-09-29 17:22:26 +07:00
Stuart Carnie 65e8b0951b Renderer: Move reflect_spirv to RenderingShaderContainer
This change introduces a new protected type, `ReflectedShaderStage` to
`RenderingShaderContainer` that derived types use to access SPIR-V and
the reflected module, `SpvReflectShaderModule` allowing implementations
to use the reflection information to compile their platform-specific
module.

* Fixes memory leak in `reflect_spirv` that would not deallocate the
  `SpvReflectShaderModule` if an error occurred.
* Removes unnecessary allocation when creating `SpvReflectShaderModule`
  by passing `NO_COPY` flag to `spvReflectCreateShaderModule2`
  constructor function.
* Replaces `VectorView` with `Span` for consistency
* Fixes unnecessary allocations in D3D12 shader container in
  `_convert_spirv_to_nir` and `_convert_spirv_to_dxil` which implicitly
  converted the old `VectorView` to a `Vector`
2025-09-30 06:40:14 +07:00
clayjohn 14b60f2264 Optimize vertex shader using mat3x4 to reduce bandwidth, load/store operations and ALUs 2025-09-26 23:20:08 +07:00
Edward Moulsdale e366471fdc Add GDSOFTCLASS to deeper inheritors of Object 2025-09-24 19:15:56 +07:00
Thaddeus Crews daa1fc97dd
Merge pull request #107547 from beicause/shader-compiler-print-content-verbose
ShaderCompiler: Optimize compilation error printing
2025-09-24 09:59:14 +07:00
Thaddeus Crews 7b8073d122
Merge pull request #107763 from Ivorforce/missing-vpv
Add missing `vpv.push_back(pv);` in `render_target_get_sdf_texture`.
2025-09-24 09:59:11 +07:00
Thaddeus Crews c62356fcaa
Merge pull request #85080 from Cykyrios/draw-ellipse
Add methods to draw ellipses
2025-09-23 12:08:51 +07:00
Thaddeus Crews 75f0f3dc55
Merge pull request #110550 from WesleyClements/master
Fix `TileMapLayer` tiles displaying incorrectly with y_sort based on visibility layer
2025-09-23 12:08:50 +07:00
Thaddeus Crews cd3a6c88fd
Merge pull request #106200 from BlueCube3310/image-16-u16
Image: Implement 16-bit unorm and uint formats
2025-09-23 12:08:46 +07:00
Thaddeus Crews cede7c8aa7
Merge pull request #109401 from DarioSamo/ubershader-for-sdf-and-material
Add ubershader support to material and SDF variants in Forward+.
2025-09-22 21:01:00 +07:00
Wesley Clements 89503e387a fixed tile map tiles displaying incorrectly based on visibility layer 2025-09-21 19:03:21 +07:00
Edward Moulsdale 12e97610a8 Add GDSOFTCLASS to six inheritors of Object 2025-09-21 16:22:29 +07:00
Cykyrios 9f7c3d00dd Add methods to draw ellipses 2025-09-19 10:45:16 +07:00
Thaddeus Crews f8dedf68e2
Merge pull request #105254 from Ivorforce/no-get-internal-ptr
Delete `VariantGetInternalPtr` and `VariantImplicitConvert`, replace with `VariantInternalAccessor`
2025-09-18 21:02:28 +07:00
Thaddeus Crews 62273fa10b
Merge pull request #110627 from clayjohn/RD-intel-mac-sky-check
Move check for sky cubemap array back into the SkyRD initializer
2025-09-18 21:02:24 +07:00
Lukas Tenbrink f81287d765 Introduce `VariantImplicitConvert<>` template for types that can be implicitly converted to and from `Variant`.
De-duplicate a lot of `VariantGetInternalPtr`, `VariantInternalAccessor`, `VariantInitializer` and `VariantDefaultInitializer`.
2025-09-19 00:20:07 +07:00
Kaleb Reid e5cd234ef7 Use correct scaling type when falling back to bilinear 2025-09-18 13:58:02 +07:00
clayjohn fc951855ed Move check for sky cubemap array back into the SkyRD initializer so it is set before being used.
Previously it was moved out of this function becuase we relied on RenderingServer::get_video_adapter_name which wasn't available yet.

However, that was unnecessary since it is just a wrapper around RenderingDevice::get_device_name() which is available.
2025-09-17 11:41:56 +07:00
Thaddeus Crews aa294bb3c8
Merge pull request #110360 from zorbathut/pr/memorybarrierrename
Rename RDD::MemoryBarrier to avoid conflicts with the Windows headers.
2025-09-17 11:34:15 +07:00
Thaddeus Crews 8c7c96e2c4
Merge pull request #108636 from clayjohn/MSAA-depth-mobile
Add depth resolve to the mobile renderer
2025-09-17 11:34:13 +07:00
Thaddeus Crews e721af5775
Merge pull request #110330 from DarioSamo/reflection-probe-size-leak
Fix reflection probes not recreating downsampled textures when mode changes.
2025-09-17 11:34:12 +07:00
Thaddeus Crews e504943212
Merge pull request #110184 from Namey5/vertex-lighting-issue
Fix rounding error in clustered vertex light culling
2025-09-17 11:34:11 +07:00
Lukas Tenbrink abe3b481ae Make conversions from `LocalVector` to `Vector` explicit. 2025-09-16 21:41:28 +07:00
Thaddeus Crews 6efa557e9b
Merge pull request #109567 from Flarkk/fix_spotlight_fog
Fix spotlight's shadow peter-panning with volumetric fog
2025-09-16 11:44:55 +07:00
Thaddeus Crews 853884ba05
Merge pull request #109143 from sievaxx/more_sampler_default_texs
Add and enable default textures for other samplers
2025-09-16 11:44:51 +07:00
Thaddeus Crews 27a3f0eb8d
Merge pull request #108206 from Calinou/transparent-viewport-no-ssr-sss-dof
Disable unsupported SSR, SSS, DoF on transparent viewports
2025-09-16 11:44:48 +07:00
Hugo Locurcio 204e310914
Tweak draw command label names for consistency
- Use Title Case for all labels, and add hyphens where relevant.
- Mention Roughness in SSR Filter's label name, as it's only enabled
  when the SSR roughness quality is not set to Disabled.
2025-09-14 01:23:47 +07:00
Hugo Locurcio 1c62ba40b7 Disable unsupported SSR, SSS, DoF on transparent viewports
For technical reasons, transparent viewports cannot support
screen-space reflections, subsurface scattering and depth of field.
Previously, enabling any of these would turn transparent viewports
invisible.
2025-09-11 14:59:07 +07:00
Ben Rog-Wilhelm e5ab5acd95 Rename RDD::MemoryBarrier to avoid conflicts with the Windows headers. 2025-09-10 05:19:36 +07:00
clayjohn 0576b12699 Increase precision of SpotLight attenuation calculation to avoid driver bug on Intel devices 2025-09-09 13:18:55 +07:00
Dario 7b923609c2 Fix reflection probes not recreating downsampled textures when mode changes. 2025-09-08 15:54:37 +07:00
Luo Zhihao 5f737952fd
ShaderCompiler: Optimize compilation error printing 2025-09-04 16:51:17 +07:00
Dario 8c4180adf4 Add GENERAL resource usage to the render graph. Fixes texture initialization in D3D12. 2025-09-02 15:18:47 +07:00
Clay John 0f0bb7d225
Merge pull request #110025 from DarioSamo/fix-shader-debug-info-take-two
Fix --generate-spirv-debug-info regression (alternate take)
2025-09-01 19:37:27 +07:00