Commit graph

338 commits

Author SHA1 Message Date
A Thousand Ships
a1846b27ea
Improve use of Ref.is_null/valid
Use `is_null` over `!is_valid` and vice versa.
2024-12-23 16:35:02 -05:00
clayjohn
ed83e5ee4b Fix shader compilation errors when using MSDF fonts with Label3D nodes 2024-12-20 17:30:55 -07:00
Pedro J. Estébanez
4bfc6f8d70 Fix deadlock possibility in threaded load of materials 2024-12-13 12:49:10 +01:00
Hugo Locurcio
3dfc832272
Replace textureSize() with a uniform in BaseMaterial3D for MSDF rendering
This uniform was already defined for other uses previously.

`textureSize()` is known to be slow on mobile platforms due to how
the drivers implement it there, so it's best avoided.
2024-12-11 15:44:06 +01:00
Thaddeus Crews
70ff57b5f3
Merge pull request #99716 from DarioSamo/material-dirty-updates
Restore dirty list for BaseMaterial3D but don't use it on resource loader.
2024-12-03 14:40:41 -06:00
Dario
34a19f07a4 Restore dirty list for BaseMaterial3D but don't use it on resource loader. 2024-11-27 10:37:19 -03:00
clayjohn
9e34e45480 Use Vector4 for texture mask in BaseMaterial to avoid converting to and from Plane 2024-11-26 21:43:46 -08:00
kobewi
b9d25580ce Fix implementation of property_can_revert() in various classes 2024-10-04 23:02:04 +02: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
Rémi Verschelde
41ffc696d2
Merge pull request #93449 from Calinou/basematerial3d-refraction-use-depth-comparison
Fix BaseMaterial3D refracting objects located in front of the material
2024-10-01 17:30:20 +02:00
Hugo Locurcio
8a485ff658
Fix BaseMaterial3D refracting objects located in front of the material
Depth comparison is now used to prevent refraction from occurring
if the pixel being refracted is located in front of the object.

For pixels slightly behind the object, a `smoothstep()` curve
is used to progressively increases refraction intensity
as the distance between the object and the refraction increases.
This avoids sudden discontinuities in the refraction.

Co-authored-by: GeneralLegendary <generallegendary456@gmail.com>
2024-09-26 15:12:31 +02:00
David Snopek
c2af6bcb59 GDExtension: Mark virtual function as is_required in extension_api.json
Co-authored-by: Jovan Gerodetti <jovan.gerodetti@titannano.de>
2024-09-11 16:48:14 -05:00
A Thousand Ships
194bdde947
Cleanup of raw nullptr checks with Ref
Using `is_valid/null` over checks with `nullptr` or `ERR_FAIL_NULL` etc.
2024-08-31 15:01:09 +02:00
Rakka Rage
ba23b22153 Enable revert button for ShaderMaterial::next_pass and ShaderMaterial::render_priority. 2024-08-22 16:28:59 -04:00
Yuri Rubinsky
72c7e51905 Use PackedVector4Array instead of float array for vec4 array uniform 2024-06-28 13:34:43 +03:00
Hugo Locurcio
281e0e6a5b
Allow BaseMaterial3D height/dither fade to work with Compatibility rendering
Compatibility is based on OpenGL ES 3.0, so the height shader
(including deep parallax) and distance fade dither modes work
just fine with no adjustments required.
2024-06-22 00:57:22 +02:00
BlueCube3310
ea683cd152 Material: Fix marking as ready 2024-06-13 13:12:55 +02:00
Rémi Verschelde
2c50e87f60
Merge pull request #89470 from jsjtxietian/msdf-uv
Fix shader compilation error when enabling texture MSDF and UV1 Triplanar at the same time
2024-05-29 22:13:30 +02:00
Rémi Verschelde
bdefe53992
Merge pull request #91909 from KoBeWi/have_fun_reviewing_this
Use Core/Scene stringnames consistently
2024-05-14 12:07:03 +02:00
kobewi
413c11357d Use Core/Scene stringnames consistently 2024-05-13 23:41:07 +02:00
Pedro J. Estébanez
187e5ef258 Let materials' shaders update happen on loader threads 2024-05-06 19:40:00 +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
jsjtxietian
0c0723c659 Fix shader compilation error when enabling texture MSDF and UV1 Triplanar at the same time 2024-03-15 12:52:28 +08:00
Hugo Locurcio
1e2b8992ae
Use raw string literals for BaseMaterial3D shader code generation
- Add range hints to all uniforms that match the BaseMaterial3D
  property hints, so that ranges in the inspector remain identical
  after converting to a shader.
- Add comments to describe selected options within the shader.
  This makes it easier to remember what each block of code does.
- Format code to follow the Godot shader language style guide.
2024-03-13 23:54:23 +01:00
clayjohn
f4c6c807eb Set a minimum of 0.01 for proximity fade to avoid undefined behavior in shader 2024-03-12 17:10:58 -07:00
Micky
cd2032a90b Optimise Object's get_argument_options 2024-02-29 18:00:54 +01:00
Erik Johnson
eab95698cd
Fix shadows for billboarded Sprite3D's 2024-02-13 10:36:38 +01:00
jsjtxietian
f04b584ed3 Fix ShaderMaterial::_property_get_revert crash when given non-exist p_name 2024-01-29 10:39:51 +08:00
Muller-Castro
96a95cb974 Add const lvalue ref to container parameters 2024-01-05 14:49:57 -03:00
Micky
ca2f340384 Fix missing autocompletion for inheriting classes 2024-01-03 00:13:04 +01:00
Hugo Locurcio
70959a9c04
Fix typo in BaseMaterial3D conversion from 3.x SpatialMaterial 2023-11-23 15:18:03 +01:00
bitsawer
1ec97a7b91 Fix several Material texture parameter updates 2023-11-01 03:10:46 +02:00
Raffaele Picca
73918b0c70 Fixing incorrect normal map when using triplanar world mapping and mesh rotation 2023-10-23 14:53:59 +02:00
bitsawer
45f2ef4c0f Fix BaseMaterial3D update with certain material settings 2023-10-11 13:51:52 +03:00
Milan Gruner
45a33cc749 Implement render mode fog_disabled and BaseMaterial3D setting Disable Fog 2023-09-05 18:15:02 +02:00
detomon
d275a7487d Initialize MSDF parameters in BaseMaterial3D with default 2023-07-28 13:24:44 +02:00
kobewi
de4a3fa151 Unify and streamline connecting to Resource changes 2023-07-17 19:35:57 +02:00
Bastiaan Olij
581d081ded Take eye offset into account for depth in StandardMaterial3D 2023-07-06 21:13:46 +10:00
Rémi Verschelde
166643df32
Merge pull request #74937 from bitsawer/fix_uniform_storage
Fix shader uniform storage conversions and crash
2023-06-09 11:04:16 +02:00
Pedro J. Estébanez
197b54370a Fix materials' shaders not updated if loaded on a non-main thread 2023-05-31 12:50:27 +02:00
bitsawer
23c375d6b4 Fix shader uniform storage conversions and crash 2023-05-29 15:17:13 +03:00
RedworkDE
69f2bc2751 Improve SelfList and fix error in BaseMaterial3D when running doctool 2023-05-22 16:38:57 +02:00
Pedro J. Estébanez
b6647a5808 Avoid sync issues in materials with scheduled shader updates 2023-05-10 18:53:41 +02:00
Clay John
12e4323f17
Merge pull request #75427 from Chaosus/shader_fix_groups_ordering
Fix shader uniform groups to prevent it sorting in alphabet order
2023-05-05 09:08:37 -07:00
bitsawer
35b06f05a2 Revert "Fix ShaderMaterial uniform type changes"
This reverts commit e55c6bfb7b.
2023-04-28 11:37:29 +03:00
bitsawer
e55c6bfb7b Fix ShaderMaterial uniform type changes 2023-04-25 15:01:56 +03:00
clayjohn
9be0a73294 Add EXPOSURE built in to spatial shaders
This allows users to restore light values to pre-pre-exposure amounts
2023-04-12 10:35:13 -07:00
Yuri Rubinsky
8ea4acee49 Fix shader uniform groups to prevent it sorting in alphabet order 2023-03-28 18:36:10 +03:00
clayjohn
c69b14e96e Add warnings for unsupported features in mobile and gl_compatibility backends 2023-02-26 12:28:02 -08:00
Juan Linietsky
34fd128723 Fix shader parameter assign
-Make sure the remap is created properly if never assigned before.

Fixes #72923. Supersedes #73066.
2023-02-18 13:13:54 +01:00