summaryrefslogtreecommitdiff
path: root/scene/3d/visual_instance_3d.cpp
AgeCommit message (Collapse)Author
2022-06-23Use the Static global illumination mode in GeometryInstance3D by defaultHugo Locurcio
This makes VoxelGI and SDFGI work out of the box with primitive meshes, loaded OBJ meshes and CSG nodes.
2022-06-11Add suffixes to all nodes and resourcesFireForge
2022-05-26Fix errors when materials attached to 3d object are not freedYuri Rubinsky
2022-05-19Use suffixes for units in nodes and resourcesAaron Franke
2022-03-28String: Remove TTR and DTR defines in non-tools buildRémi Verschelde
This ensures we don't use TTR in runtime code, as it's specifically meant to source translations for the editor.
2022-03-10Discern between virtual and abstract class bindingsreduz
* 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.
2022-02-15Use `switch` consistently in `_notification` (`scene` folder)Rémi Verschelde
2022-01-20Merge pull request #55360 from Calinou/rename-bake-mode-propertiesRémi Verschelde
2022-01-05Added material_overlay property to MeshInstance3DFernando Cosentino
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.
2022-01-04Merge pull request #55370 from ↵JFonS
Calinou/geometryinstance3d-lod-fade-node-configuration-warning Emit node configuration warnings for GeometryInstance3D distance fade
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2021-12-14Rename and reorder bake mode properties for consistencyHugo Locurcio
The order now goes from least to most computationally expensive: - Disabled - Static - Dynamic
2021-11-26Emit node configuration warnings for GeometryInstance3D distance fadeHugo Locurcio
The visibility range begin/end margin properties must be set above 0.0 for the fade transition to be visible.
2021-10-25Implement distance fade and transparencyJFonS
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>
2021-08-13Merge pull request #51607 from aaronfranke/includesRémi Verschelde
Fix some unnecessary includes
2021-08-13Fix some unnecessary includesAaron Franke
2021-08-12Use the Unicode multiplication symbol where relevantHugo Locurcio
2021-08-12Uniformize layer names, script methods and documentationPouleyKetchoupp
- 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
2021-07-28Add node configuration warning for GeometryInstance3D distanceHugo Locurcio
2021-07-23Use C++ iterators for Lists in many situationsAaron Franke
2021-07-07Merge pull request #50193 from reduz/fix-command-queue-crashRémi Verschelde
Fix Command Queue Crash
2021-07-07Fix Command Queue Crashreduz
* No longer allow sending an object (texture) to the server as material parameter * Keep a parameter cache locally in ShaderMaterial
2021-07-04Allow using ORMMaterial3D by using BaseMaterial3D as a resource hintHugo Locurcio
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).
2021-07-01Use PROPERTY_USAGE_NONE instead of 0 for no property usageAaron Franke
Also use const more often.
2021-06-14Implement visibility range and dependencies.jfons
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).
2021-06-03Rename Transform to Transform3D in coreAaron Franke
2021-04-23Implement occlusion cullingjfons
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.
2021-02-10Removed _change_notifyreduz
-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.
2021-02-07Initialize class variables with default values in scene/ [1/2]Rafał Mikrut
2021-02-04doc: Don't bind argument names with p_ prefixRémi Verschelde
This prefix is used in the C++ codebase, not in the scripting API.
2021-01-01Update copyright statements to 2021Rémi Verschelde
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 🎆
2020-12-18Implement automatic LOD (Level of Detail)reduz
-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
2020-05-14Style: Enforce braces around if blocks and loopsRémi Verschelde
Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2020-05-14Style: Enforce separation line between function definitionsRémi Verschelde
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.
2020-05-14Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde
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.
2020-05-10New lightmapperJuan Linietsky
-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)
2020-04-18Change non-existent World to World3Dqarmin
2020-04-17Implement global and per instance shader uniforms.Juan Linietsky
Adds two keywords to shader language for uniforms: -'global' -'instance' This allows them to reference values outside the material.
2020-03-27Renaming of servers for coherency.Juan Linietsky
VisualServer -> RenderingServer PhysicsServer -> PhysicsServer3D Physics2DServer -> PhysicsServer2D NavigationServer -> NavigationServer3D Navigation2DServer -> NavigationServer2D Also renamed corresponding files.
2020-03-27Renamed 2D and 3D nodes to make their types explicitJuan Linietsky
Fixes #30736.