Commit Graph

299 Commits

Author SHA1 Message Date
clayjohn
02efdb28dc Unify y-flip behavior for sky in RD backends 2024-11-19 16:59:04 -08:00
Thaddeus Crews
fd4c29a189
Merge pull request #98683 from clayjohn/wireframe
Some checks failed
🔗 GHA / 📊 Static checks (push) Has been cancelled
🔗 GHA / 🤖 Android (push) Has been cancelled
🔗 GHA / 🍏 iOS (push) Has been cancelled
🔗 GHA / 🐧 Linux (push) Has been cancelled
🔗 GHA / 🍎 macOS (push) Has been cancelled
🔗 GHA / 🏁 Windows (push) Has been cancelled
🔗 GHA / 🌐 Web (push) Has been cancelled
🔗 GHA / 🪲 Godot CPP (push) Has been cancelled
Ensure shadow material and mesh are not used with wireframe mode
2024-11-18 09:23:54 -06:00
BlueCube3310
bb3d0045b0 Fix updating lightmap captures on Mobile 2024-11-17 19:29:21 +01:00
clayjohn
90b4b48b5a Ensure shadow material and mesh are not used with wireframe mode
And in the Compatibility renderer actually use the wireframe render mode
2024-11-16 22:25:00 -08:00
Thaddeus Crews
88d9903f6d
Merge pull request #86138 from EnlightenedOne/master
Fix Frustum Sky projection translation logic shearing
2024-11-04 21:52:07 -06:00
Dario
53099c56f0 Add multiple specialization constants to Forward+ and Mobile. 2024-11-04 14:35:40 -03:00
EnlightenedOne
1d141ab32a Fix Frustum Sky projection translation logic, all pipelines, fixes 63863 2024-11-02 21:34:55 +00:00
Dario
427ba09efc Fix soft shadows by increasing the bit count for specialization constants. 2024-10-28 10:26:50 -03:00
Chaosus
463e81413e Make OUTPUT_IS_SRGB/CLIP_SPACE_FAR shader built-ins global 2024-10-24 12:32:05 +03:00
Dario
e2c6daf7ef Implement asynchronous transfer queues, thread guards on RenderingDevice. Add ubershaders and rework pipeline caches for Forward+ and Mobile.
- Implements asynchronous transfer queues from PR #87590.
- Adds ubershaders that can run with specialization constants specified as push constants.
- Pipelines with specialization constants can compile in the background.
- Added monitoring for pipeline compilations.
- Materials and shaders can now be created asynchronously on background threads.
- Meshes that are loaded on background threads can also compile pipelines as part of the loading process.
2024-10-02 15:11:58 -03:00
ywmaa
0a9ad8f9de
Implement vertex shading
This adds support in all backends, but the Compatibility renderer works the best.
Mobile and Forward+ can only support one directional light shader (the first in the tree)
While the Compatibility renderer supports any number of shadows.

Co-authored-by: Clay John <claynjohn@gmail.com>
2024-09-29 00:36:09 +02:00
Thaddeus Crews
9f9ee0c813
SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
Thaddeus Crews
b37fc1014a
Style: Apply new clang-format changes 2024-09-20 08:09:48 -05:00
clayjohn
7ff106f828 Use distance to AABB surface to calculate Mesh LOD instead of using supports 2024-09-11 14:17:09 -07:00
Chaosus
f538376c3b Add CLIP_SPACE_FAR built-in to spatial shader 2024-08-27 08:48:46 +03:00
Matias N. Goldberg
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
BlueCube3310
ef9bb1a207 Implement support for bicubic lightmap filtering
Co-authored-by: Calinou <hugo.locurcio@hugo.pro>
2024-08-19 09:52:09 +02:00
Rémi Verschelde
590628feda
Merge pull request #86516 from jsjtxietian/fix-camera-direction
Fix incorrect `CAMERA_DIRECTION_WORLD` calculation
2024-07-18 10:45:20 +02:00
clayjohn
4cbc967f50 Use a spec constant to control whether the MultiMesh branch is used in the vertex shader.
This works around a bug on the Quest3 and slightly improves performance on all mobile devices at the cost of increased pipeline count.
2024-07-12 15:44:06 -07:00
Rémi Verschelde
46e8377a5e
Merge pull request #93960 from BastiaanOlij/fix_mobile_compositor
Pre transparent compositor effects needs to run later
2024-07-11 00:27:06 +02:00
Bastiaan Olij
e42870b4d1 Pre transparent compositor effects needs to run later 2024-07-05 12:37:26 +10:00
Bastiaan Olij
6ed6212949 Make RenderSceneData take projection correction into account 2024-06-27 10:44:30 +10:00
clayjohn
267ea14616 Fix LOD selection in compatibility backend and clean up LOD code 2024-05-23 11:30:22 -07:00
clayjohn
c5346a62b0 Only apply LOD when camera is outside the AABB of mesh in mobile renderer.
This copies the existing logic from the Forward+ renderer
2024-05-21 18:32:04 -07:00
Bastiaan Olij
6efaaecde2 Skip rendering sky if viewport is set to transparent background 2024-05-13 11:04:06 +10:00
Rob Blanckaert
64c04d95aa Fix shader error on mobile when using LIGHT_VERTEX 2024-05-04 11:02:05 -07:00
QbieShay
e41064388e reverted naming to premul alpha (no T)
Initially 3d had premulT alpha as a keyword.
Since Canvas item uses mixed premul and premult as keywords,
3D is changed as well to keep consistency with 2D.
Unfortunately this keeps inconsistency with the internal ENUM.
2024-05-01 22:24:49 +02:00
QbieShay
41a2b0e83e Added premult alpha blending to 3D (spatial) shaders.
Co-authored-by: jitspoe <jitspoe@yahoo.com>
Co-authored-by: Clay John <claynjohn@gmail.com>
2024-05-01 00:53:29 +02:00
Rob Blanckaert
ffe0b869f5 Add LIGHT_VERTEX to fragment shader
Adds a new variable to the fragment shader to specify
the vertex position used when calculating lighting.
2024-04-25 06:56:02 -07:00
clayjohn
eb62c5b27f Revert change to default depth clear value in draw_list_begin 2024-04-17 19:08:22 -07:00
Rémi Verschelde
10d67e590d
Merge pull request #90191 from BastiaanOlij/fix_mobile_canvas_copy
Don't use subpasses when we're using Canvas background mode in Mobile
2024-04-06 13:06:37 +02:00
Khasehemwy
d950f5f838
Use Reverse Z for the depth buffer 2024-04-04 13:54:15 +02:00
Bastiaan Olij
9e9a6fb6d6 Can't use subpasses when we're using Canvas background mode in Mobile 2024-04-04 15:59:11 +11:00
David Sullivan
dfa326ef55 Fix: Address mobile resource leaks in render
Update render_forward_mobile destructor to include instance buffers.
Update render_scene_buffers_rd cleanup to include weight buffers / blur
textures.
2024-03-15 14:48:12 -04:00
Hugo Locurcio
26a220bd31
Make Overdraw, Lighting and Shadow Splits debug draw modes ignore decals
This also makes the Overdraw and Shadow Splits debug draw modes ignore fog.
The Lighting debug draw mode still displays fog as that debug draw mode
is intended to preview scene lighting, and fog has an impact on how
lighting is perceived.
2024-03-07 17:40:49 +01:00
Bastiaan Olij
5a98845655 Implement hooks into renderer 2024-02-18 21:54:21 +11:00
Eidolon
08f4560e69 Add optional depth fog 2024-02-17 22:39:34 -03:00
Erik Johnson
eab95698cd
Fix shadows for billboarded Sprite3D's 2024-02-13 10:36:38 +01:00
Yuri Sizov
3f7ea71e88 Merge pull request #87495 from jsjtxietian/USE_LIGHT_SHADER_CODE
Clean up outdated `USE_LIGHT_SHADER_CODE` usage
2024-01-25 16:27:14 +01:00
Yuri Sizov
b698204a1e Merge pull request #87505 from BastiaanOlij/fix_mobile_refprobe_validation
Fix framebuffer created for reflection probe in mobile renderer
2024-01-24 14:08:52 +01:00
Yuri Sizov
2ce450f8bc Merge pull request #84894 from clayjohn/tangent-error-message
Store ArrayMesh path in RenderingServer for use in error messages
2024-01-24 14:07:47 +01:00
jsjtxietian
2004ad1ac5 Clean up outdated USE_LIGHT_SHADER_CODE usage 2024-01-24 12:30:27 +08:00
Bastiaan Olij
914eecaddb Fix framebuffer created for reflection probe in mobile renderer 2024-01-24 00:51:51 +11:00
Dario
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
jsjtxietian
89d7a2f0a5 Fix incorrect CAMERA_DIRECTION_WORLD calculation 2023-12-26 14:09:44 +08:00
clayjohn
43cf21cb71 Use best fit normals for storing screen space normals 2023-12-21 14:41:29 -07:00
Yuri Sizov
2d0ee20ff3 Merge pull request #86219 from clayjohn/RD-samplers-hotfix
Reduce the number of samplers used by the scene shaders
2023-12-16 17:50:10 +01:00
clayjohn
a5399ab5af Reduce the number of samplers used by the scene shaders
The hard limit for Apple devices is 16 samplers per stage. So we need to ensure we use less than that
2023-12-15 17:13:44 -07:00
Bastiaan Olij
22cd145177 Merge passes in Vulkan mobile renderer 2023-12-16 09:51:35 +11:00
Yuri Sizov
ee1bf15924 Merge pull request #84637 from clayjohn/RD-sampler-bias
Use render pass uniform set to store viewport samplers.
2023-12-08 15:23:18 +01:00