Commit graph

305 commits

Author SHA1 Message Date
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
QbieShay 7881422901 make particle billboard take into account non-uniform scale 2023-02-13 21:18:55 +01:00
bruvzg b4fe514aa3
[Sprite3D/Label3D] Expose alpha antialiasing properties. 2023-01-31 10:46:38 +02:00
bruvzg 1c774a6083
Fix unsafe murmur3 hash use for the default material keys, expose alpha hash transparency mode for default materials and Label3D and Sprite3D. 2023-01-24 12:24:53 +02:00
Rémi Verschelde 1dfd236f15
Merge pull request #70377 from dsnopek/server-export-mk2
Add "dedicated server" export mode which can strip unneeded visual resources
2023-01-23 22:13:28 +01:00
David Snopek 74458b6e9b Add "dedicated server" export mode which can strip unneeded visual resources 2023-01-23 13:24:54 -06:00
Rémi Verschelde 5b1df48c6c
Convert en_GB spelling to en_US with codespell 2023-01-23 11:02:20 +01:00
Juan Linietsky 7dbc458bb4 Clean up shader parameter remap
This PR is a follow up to #64092, which fixed important issues but it was implemented in an overly complex and inefficient way (because it forced the default code path to always go through string operations).
This cleans up all the shader parameter code.

This fixes #54336. Also fixes #56219 because, as the new code never queries the RenderingServer on load, potential deadlocks are avoided.

**NOTE**: materials saved between #62972 and #64092 will no longer work and will need to be resaved in an earlier version.
2023-01-21 12:56:28 +01:00
clayjohn faea9f5c10 Remove SCREEN_TEXTURE, DEPTH_TEXTURE, and NORMAL_ROUGHNESS_TEXTURE
in favour of texture hints
2023-01-18 19:52:47 -08:00
Rémi Verschelde 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
Adam Scott ea33001b95 Add safety-checks before some servers free() 2022-12-29 16:23:38 -05:00
Hugo Locurcio d926be72ed
Use circular fade instead of linear fade for distance fade
This makes distance fade look the same regardless of the camera angle,
for all distance fade modes (Pixel Alpha, Pixel Dither, Object Dither).
Distance fade now behaves like fog in this regard.
2022-12-05 22:35:11 +01:00
kobewi 9a3960daa5 Simplify GDVIRTUAL_REQUIRED_CALL calls 2022-11-30 18:36:57 +01:00
kobewi d06a8320e5 Simplify GDVIRTUAL_CALL calls 2022-10-19 00:05:48 +02:00
Rémi Verschelde 6d534f6e89 Merge pull request #66221 from Mickeon/painstakingly-appending-ds-en-you-tea-es
Rename remaining "*_enable" to "*_enabled"
2022-10-11 16:17:02 +02:00
Rémi Verschelde 7ab01450cf Fix MSVC warning C4702: unreachable code
Part of #66537.
2022-09-28 16:46:48 +02:00
Micky c1b5b68eee Rename remaining "*_enable" to "*_enabled"
Material.`proximity_fade_enable` -> `proximity_fade_enabled`
Material.`set_proximity_fade` -> `set_proximity_fade_enabled`
(Material.`is_proximity_fade_enabled` is unchanged)

Area3D.`reverb_bus_enable` -> `reverb_bus_enabled`
(`set_use_reverb_bus` & `is_using_reverb_bus` are unchanged)

RDPipelineRasterizationState:
`depth_bias_enable` -> `depth_bias_enabled`
`set_depth_bias_enable` -> `set_depth_bias_enabled`
`get_depth_bias_enable` -> `get_depth_bias_enabled`

Bonus:
Area3D.`set_reverb_bus` -> `set_reverb_bus_name`
Area3D.`get_reverb_bus` -> `set_get_reverb_bus_name`
2022-09-21 22:47:46 +02:00
Yuri Rubinsky 4f0e0f1650 Fix sorting of uniform items in the material properties
Co-authored-by: Chia-Hsiang Cheng <garychia@users.noreply.github.com>
2022-09-16 08:59:13 +03:00
Rémi Verschelde b094e4f1a1
Merge pull request #64092 from nathanfranke/shader-uniform 2022-09-14 22:07:15 +02:00
Johan Aires Rastén bb657c04fc Calculate MODELVIEW_NORMAL_MATRIX for billboard materials
Solves #65627
2022-09-10 21:08:29 +02:00
Nathan Franke 82d2a97a83
prefix shader parameters with "shader_parameter/" 2022-09-02 20:41:00 -05:00
Rémi Verschelde c82bbc38a5 Merge pull request #64952 from Chaosus/vs_rename_uniform_to_param 2022-09-02 13:49:53 +02:00
Yuri Rubinsky 8191b3c110 Rename uniform to parameter across the engine 2022-09-01 11:42:57 +03:00
clayjohn 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
Hugo Locurcio 64717d64cd
Improve documentation for BaseMaterial3D's alpha scissor threshold 2022-08-29 14:54:06 +02:00
Rémi Verschelde cb62c91c12
Merge pull request #58600 from Calinou/material-triplanar-sharpness-clamp 2022-08-22 22:21:33 +02:00
Yuri Sizov 1a24c9e14b Make _validate_property a multilevel method 2022-08-22 18:35:11 +03:00
Yuri Sizov 980f5f32f4 Make property_*_revert methods multilevel and expose them for scripting 2022-08-18 00:03:53 +03:00
Nathan Franke 3d7d4ccada
capitalize shader uniform groups 2022-08-08 02:21:04 -05:00
Hugo Locurcio e919e51a6b
Use interleaved gradient noise for distance fade
This provides better visuals and performance compared to the previous
ordered dither.
2022-08-05 11:35:34 +02:00
Hugo Locurcio db22b7ded0
Rename shader parameter uniform setter/getter methods for consistency
`shader_uniform` is now consistenly used across both per-shader
and per-instance shader uniform methods. This makes methods easier
to find in the class reference when looking for them.
2022-08-04 23:17:06 +02:00
Hugo Locurcio c6cca43419
Tweak StandardMaterial3D's default height properties
- Set the default height scale to 5.0 and multiply it by 0.01 in the shader.
- Document heightmap properties in BaseMaterial3D class reference.
2022-08-04 09:57:55 +02:00
Hugo Locurcio fa019f6e14
Change default material alpha scissor threshold to 0.5
This makes the default behavior consistent between SpriteBase3D,
BaseMaterial3D and imported glTF scene materials.

Alpha scissor threshold property hints now allows for more precise
adjustments as well.
2022-08-01 02:00:16 +02:00
Hugo Locurcio 1dfd94c63f
Hide triplanar subproperties when triplanar is disabled in BaseMaterial3D
This also renames some sections for consistency.
2022-07-30 21:41:26 +02:00