summaryrefslogtreecommitdiffstats
path: root/scene/3d/visual_instance_3d.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rename shader parameter uniform setter/getter methods for consistencyHugo Locurcio2022-08-041-16/+16
| | | | | | `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.
* Tweak Decal distance fade defaults and add property hintsHugo Locurcio2022-07-271-4/+5
| | | | | | | | | The new default values are more usable in real world scenarios when smooth fading of distant decals is desired for performance reasons. The Decal distance fade property hints were adjusted based on the GeometryInstance3D visibility range fade property hints. `or_greater` was also added to allow specifying larger values if needed.
* Use the Static global illumination mode in GeometryInstance3D by defaultHugo Locurcio2022-06-231-2/+0
| | | | | This makes VoxelGI and SDFGI work out of the box with primitive meshes, loaded OBJ meshes and CSG nodes.
* Add suffixes to all nodes and resourcesFireForge2022-06-111-4/+4
|
* Fix errors when materials attached to 3d object are not freedYuri Rubinsky2022-05-261-0/+9
|
* Use suffixes for units in nodes and resourcesAaron Franke2022-05-191-1/+1
|
* String: Remove TTR and DTR defines in non-tools buildRémi Verschelde2022-03-281-3/+3
| | | | | This ensures we don't use TTR in runtime code, as it's specifically meant to source translations for the editor.
* Discern between virtual and abstract class bindingsreduz2022-03-101-0/+9
| | | | | | | | | | | | | | * Previous "virtual" classes (which can't be instantiated) are not corretly named "abstract". * Added a new "virtual" category for classes, they can't be instantiated from the editor, but can be inherited from script and extensions. * Converted a large amount of classes from "abstract" to "virtual" where it makes sense. Most classes that make sense have been converted. Missing: * Physics servers * VideoStream * Script* classes. which will go in a separate PR due to the complexity involved.
* Use `switch` consistently in `_notification` (`scene` folder)Rémi Verschelde2022-02-151-12/+3
|
* Merge pull request #55360 from Calinou/rename-bake-mode-propertiesRémi Verschelde2022-01-201-4/+4
|\
| * Rename and reorder bake mode properties for consistencyHugo Locurcio2021-12-141-4/+4
| | | | | | | | | | | | | | | | The order now goes from least to most computationally expensive: - Disabled - Static - Dynamic
* | Added material_overlay property to MeshInstance3DFernando Cosentino2022-01-051-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Applying overlay materials into multi-surface meshes currently requires adding a next pass material to all the surfaces, which might be cumbersome when the material is to be applied to a range of different geometries. This also makes it not trivial to use AnimationPlayer to control the material in case of visual effects. The material_override property is not an option as it works replacing the active material for the surfaces, not adding a new pass. This commit adds the material_overlay property to GeometryInstance3D (and therefore MeshInstance3D), having the same reach as material_override (that is, all surfaces) but adding a new material pass on top of the active materials, instead of replacing them.
* | Merge pull request #55370 from ↵JFonS2022-01-041-0/+11
|\ \ | | | | | | | | | | | | Calinou/geometryinstance3d-lod-fade-node-configuration-warning Emit node configuration warnings for GeometryInstance3D distance fade
| * | Emit node configuration warnings for GeometryInstance3D distance fadeHugo Locurcio2021-11-261-0/+11
| |/ | | | | | | | | The visibility range begin/end margin properties must be set above 0.0 for the fade transition to be visible.
* / Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
|/ | | | Happy new year to the wonderful Godot community!
* Implement distance fade and transparencyJFonS2021-10-251-5/+34
| | | | | | | | | | | | | | | | | | | | | The built-in ALPHA in spatial shaders comes pre-set with a per-instance transparency value. Multiply by it if you want to keep it. The transparency value of any given GeometryInstance3D is affected by: - Its new "transparency" property. - Its own visiblity range when the new "visibility_range_fade_mode" property is set to "Self". - Its parent visibility range when the parent's fade mode is set to "Dependencies". The "Self" mode will fade-out the instance when reaching the visibility range limits, while the "Dependencies" mode will fade-in its dependencies. Per-instance transparency is only implemented in the forward clustered renderer, support for mobile should be added in the future. Co-authored-by: reduz <reduzio@gmail.com>
* Merge pull request #51607 from aaronfranke/includesRémi Verschelde2021-08-131-2/+0
|\ | | | | Fix some unnecessary includes
| * Fix some unnecessary includesAaron Franke2021-08-131-2/+0
| |
* | Use the Unicode multiplication symbol where relevantHugo Locurcio2021-08-121-1/+1
|/
* Uniformize layer names, script methods and documentationPouleyKetchoupp2021-08-121-10/+14
| | | | | | | - Back to 1-based layer names to make it clearer in editor UI - Layer bit accessors are renamed to layer value and 1-based too - Uniform errors and documentation in render and physics - Fix a few remaining collision_layer used in place of collision_mask
* Add node configuration warning for GeometryInstance3D distanceHugo Locurcio2021-07-281-0/+12
|
* Use C++ iterators for Lists in many situationsAaron Franke2021-07-231-2/+1
|
* Merge pull request #50193 from reduz/fix-command-queue-crashRémi Verschelde2021-07-071-1/+6
|\ | | | | Fix Command Queue Crash
| * Fix Command Queue Crashreduz2021-07-071-1/+6
| | | | | | | | | | * No longer allow sending an object (texture) to the server as material parameter * Keep a parameter cache locally in ShaderMaterial
* | Allow using ORMMaterial3D by using BaseMaterial3D as a resource hintHugo Locurcio2021-07-041-1/+1
|/ | | | | | | | Previously, only StandardMaterial3D could be defined as an alternative to ShaderMaterial. This also reorders the CanvasItemMaterial property hints to follow alphabetical order (which is enforced by the inspector).
* Use PROPERTY_USAGE_NONE instead of 0 for no property usageAaron Franke2021-07-011-2/+2
| | | | Also use const more often.
* Implement visibility range and dependencies.jfons2021-06-141-33/+33
| | | | | | | | | | | | | | | | | | | | | This commit adds the following properties to GeometryInstance3D: `visibility_range_begin`, `visibility_range_begin_margin`, `visibility_range_end`, `visibility_range_end_margin`. Together they define a range in which the GeometryInstance3D will be visible from the camera, taking hysteresis into account for state changes. A begin or end value of 0 will be ignored, so the visibility range can be open-ended in both directions. This commit also adds the `visibility_parent` property to 'Node3D'. Which defines the visibility parents of the node and its subtree (until another parent is defined). Visual instances with a visibility parent will only be visible when the parent, and all of its ancestors recursively, are hidden because they are closer to the camera than their respective `visibility_range_begin` thresholds. Combining visibility ranges and visibility parents users can set-up a quick HLOD system that shows high detail meshes when close (i.e buildings, trees) and merged low detail meshes for far away groups (i.e. cities, woods).
* Rename Transform to Transform3D in coreAaron Franke2021-06-031-1/+1
|
* Implement occlusion cullingjfons2021-04-231-5/+18
| | | | | | | | | Added an occlusion culling system with support for static occluder meshes. It can be enabled via `Project Settings > Rendering > Occlusion Culling > Use Occlusion Culling`. Occluders are defined via the new `Occluder3D` resource and instanced using the new `OccluderInstance3D` node. The occluders can also be automatically baked from a scene using the built-in editor plugin.
* Removed _change_notifyreduz2021-02-101-1/+0
| | | | | | -For inspector refresh, the inspector now detects if a property change by polling a few times per second and then does update the control if so. This process is very cheap. -For property list refresh, a new signal (property_list_changed) was added to Object. _change_notify() is replaced by notify_property_list_changed() -Changed all objects using the old method to the signal, or just deleted the calls to _change_notify(<property>) since they are unnecesary now.
* Initialize class variables with default values in scene/ [1/2]Rafał Mikrut2021-02-071-13/+0
|
* doc: Don't bind argument names with p_ prefixRémi Verschelde2021-02-041-1/+1
| | | | This prefix is used in the C++ codebase, not in the scripting API.
* 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 🎆
* Implement automatic LOD (Level of Detail)reduz2020-12-181-0/+16
| | | | | | | -Happens on import by default for all models -Just works (tm) -Biasing can be later adjusted per node or per viewport (as well as globally) -Disabled AABB.get_support test because its broken
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-1/+2
| | | | | 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-36/+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.
* New lightmapperJuan Linietsky2020-05-101-29/+64
| | | | | | | -Added LocalVector (needed it) -Added stb_rect_pack (It's pretty cool, we could probably use it for other stuff too) -Fixes and changes all around the place -Added library for 128 bits fixed point (required for Delaunay3D)
* Change non-existent World to World3Dqarmin2020-04-181-2/+2
|
* Implement global and per instance shader uniforms.Juan Linietsky2020-04-171-0/+75
| | | | | | | | Adds two keywords to shader language for uniforms: -'global' -'instance' This allows them to reference values outside the material.
* Renaming of servers for coherency.Juan Linietsky2020-03-271-23/+23
| | | | | | | | | | VisualServer -> RenderingServer PhysicsServer -> PhysicsServer3D Physics2DServer -> PhysicsServer2D NavigationServer -> NavigationServer3D Navigation2DServer -> NavigationServer2D Also renamed corresponding files.
* Renamed 2D and 3D nodes to make their types explicitJuan Linietsky2020-03-271-0/+335
Fixes #30736.