summaryrefslogtreecommitdiffstats
path: root/scene/resources/shader.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix copyright headers referring to GodotSpartan3222024-10-271-2/+2
|
* Rebrand preambles to RedotSpartan3222024-10-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | (cherry picked from commit e8542b06acca3c1bdeee4b528411771f0819f084) Credits: Co-authored-by: Skogi <skogi.b@gmail.com> Co-authored-by: Spartan322 <Megacake1234@gmail.com> Co-authored-by: swashberry <swashdev@pm.me> Co-authored-by: Christoffer Sundbom <christoffer_karlsson@live.se> Co-authored-by: Dubhghlas McLaughlin <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: McDubh <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: Dubhghlas McLaughlin <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: radenthefolf <radenthefolf@gmail.com> Co-authored-by: John Knight <80524176+Tekisasu-JohnK@users.noreply.github.com> Co-authored-by: Adam Vondersaar <adam.vondersaar@uphold.com> Co-authored-by: decryptedchaos <nixgod@gmail.com> Co-authored-by: zaftnotameni <122100803+zaftnotameni@users.noreply.github.com> Co-authored-by: Aaron Benjamin <lifeartstudios@gmail.com> Co-authored-by: wesam <108880473+wesamdev@users.noreply.github.com> Co-authored-by: Mister Puma <MisterPuma80@gmail.com> Co-authored-by: Aaron Benjamin <lifeartstudios@gmail.com> Co-authored-by: SingleError <isaaconeoneone@gmail.com> Co-authored-by: Bioblaze Payne <BioblazePayne@gmail.com>
* Prevent add shader uniform doc when DocTool is not initedjsjtxietian2024-05-201-1/+1
|
* Merge pull request #91549 from magian1127/4.0ChangeHighlightingStartKeyRémi Verschelde2024-05-171-1/+1
|\ | | | | | | Resolve conflict between shader uniform tooltips `/**` and general annotation `/**/`.
| * Resolve conflict between shader uniform tooltips "/**" and general ↵Magian2024-05-141-1/+1
| | | | | | | | annotation "/**/".
* | Use Core/Scene stringnames consistentlykobewi2024-05-131-1/+0
|/
* Don't run Shader doc comments logic outside the editorRémi Verschelde2024-04-291-9/+5
| | | | Fixes #91306.
* Implement tooltips for shader uniform in the inspector.Magian2024-04-261-0/+43
| | | | using regular expressions
* Fix empty shader resource loadingbitsawer2023-09-041-2/+4
|
* Fix Shader and ShaderInclude resource loadingbitsawer2023-08-171-5/+8
|
* Unify and streamline connecting to Resource changeskobewi2023-07-171-2/+2
|
* Fix shader type detectionbitsawer2023-07-101-14/+15
|
* Fix shader preprocessor cyclic include handlingbitsawer2023-05-291-8/+8
|
* Fix several shader preprocessor include issuesbitsawer2023-01-271-1/+12
|
* Fix shader include dependency handlingbitsawer2023-01-221-2/+5
|
* Clean up shader parameter remapJuan Linietsky2023-01-211-9/+10
| | | | | | | | | 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.
* 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".
* Add safety-checks before some servers `free()`Adam Scott2022-12-291-0/+1
|
* Use system fonts as fallback and improve system font handling.bruvzg2022-12-041-1/+1
| | | | | | | Add support for font weight and stretch selection when using system fonts. Add function to get system fallback font from a font name, style, text, and language code. Implement system font support for Android. Use system fonts as a last resort fallback.
* Fix `Shader::has_parameter` to return a correct valueYuri Rubinsky2022-11-111-1/+1
|
* Rename `uniform` to `parameter` across the engineYuri Rubinsky2022-09-011-20/+20
|
* Implement coloring for disabled branches in the shader editorYuri Rubinsky2022-08-141-1/+1
|
* Rename shader parameter uniform setter/getter methods for consistencyHugo Locurcio2022-08-041-5/+5
| | | | | | `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.
* Swap arguments of ResourceSaver.save()kobewi2022-07-291-1/+1
|
* Implement shader uniform groups/subgroupsYuri Rubinsky2022-07-261-5/+9
|
* Clean up Shader Preprocessorreduz2022-07-221-12/+29
| | | | | | | | | * Moved preprocessor to Shader and ShaderInclude * Clean up RenderingServer side * Preprocessor is separate from parser now, but it emits tokens with include location hints. * Improved ShaderEditor validation code * Added include file code completion * Added notification for all files affected by a broken include.
* Adding shader preprocessor supportYuri Roubinsky2022-07-221-1/+21
| | | | Co-authored-by: TheOrangeDay <6472143+TheOrangeDay@users.noreply.github.com>
* Replace most uses of Map by HashMapreduz2022-05-161-2/+2
| | | | | | | | | | | | * Map is unnecessary and inefficient in almost every case. * Replaced by the new HashMap. * Renamed Map to RBMap and Set to RBSet for cases that still make sense (order matters) but use is discouraged. There were very few cases where replacing by HashMap was undesired because keeping the key order was intended. I tried to keep those (as RBMap) as much as possible, but might have missed some. Review appreciated!
* Remove `RES` and `REF` typedefs in favor of spelled out `Ref<>`Hugo Locurcio2022-05-031-4/+4
| | | | | | These typedefs don't save much typing compared to the full `Ref<Resource>` and `Ref<RefCounted>`, yet they sometimes introduce confusion among new contributors.
* Make FileAccess and DirAccess classes reference counted.bruvzg2022-04-111-4/+1
|
* Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
| | | | Happy new year to the wonderful Godot community!
* Fix default_texture_param in shader pipeline to support uniform arraysYuri Roubinsky2021-11-121-13/+21
|
* Rename `PROPERTY_USAGE_NOEDITOR` to `PROPERTY_USAGE_NO_EDITOR`Hugo Locurcio2021-11-031-1/+1
| | | | | This is consistent with other constants that include `NO`, such as `PROPERTY_HINT_COLOR_NO_ALPHA`.
* Addition of FogVolumes, FogShaders, FogMaterial, and overhaul of VolumetricFogclayjohn2021-10-281-0/+3
| | | | Co-authored-by: Brian Semrau <brian.semrau@gmail.com>
* Use range iterators for `Map`Lightning_A2021-09-301-2/+2
|
* Preserve original name in shader params cacheAaron Franke2021-08-051-1/+2
|
* Use C++ iterators for Lists in many situationsAaron Franke2021-07-231-3/+2
|
* Rename `instance()`->`instantiate()` when it's a verbLightning_A2021-06-191-1/+1
|
* Core: Move DirAccess and FileAccess to `core/io`Rémi Verschelde2021-06-111-1/+1
| | | | | File handling APIs are typically considered part of I/O, and we did have most `FileAccess` implementations in `core/io` already.
* Rename the `.shader` file extension to `.gdshader`Hugo Locurcio2021-03-241-3/+3
| | | | | This lets third-party software recognize Godot shaders more easily, without relying on guesswork since the `.shader` extension is generic.
* Improve resource load cachereduz2021-02-111-1/+1
| | | | | | -Added a new method in Resource: reset_state , used for reloading the same resource from disk -Added a new cache mode "replace" in ResourceLoader, which reuses existing loaded sub-resources but resets their data from disk (or replaces them if they chaged type) -Because the correct sub-resource paths are always loaded now, this fixes bugs with subresource folding or subresource ordering when saving.
* Initialize class variables with default values in scene/ [2/2]Rafał Mikrut2021-02-091-2/+0
|
* 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 🎆
* Variant: Rename Type::_RID to Type::RIDRémi Verschelde2020-11-091-1/+2
| | | | | | | | The underscore prefix was used to avoid the conflict between the `RID` class name and the matching enum value in `Variant::Type`. This can be fixed differently by prefixing uses of the `RID` class in `Variant` with the scope resolution operator, as done already for `AABB`.
* doc: Sync classref with current sourceRémi Verschelde2020-09-041-2/+0
|
* Set "shader_param/" prefix in Shader::has_param()Marcus Brummer2020-06-041-1/+1
|
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-6/+11
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: Enforce separation line between function definitionsRémi Verschelde2020-05-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | 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-22/+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.
* Exposed RenderingDevice to script APIJuan Linietsky2020-04-201-1/+1
| | | | | | | | | | | | | Also added an easier way to load native GLSL shaders. Extras: Had to fix no-cache for subresources in resource loader, it was not properly working, making shaders not properly reload. Note: The precommit hooks are broken because they don't seem to support enums from one class being used in another. Feel free to fix this after merging this PR.