summaryrefslogtreecommitdiff
path: root/scene/resources/material.cpp
AgeCommit message (Collapse)Author
2022-02-11Fix SelfList::remove error when animating Sprite3DIgor Kordiukiewicz
2022-01-06Move metallic and roughness automated assignment to an inspector UndoRedoSaracenOne
callback.
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2021-12-15Rename shader hint `filter_anisotropy` to `filter_anisotropic`Yuri Roubinsky
2021-12-15Rename shader hint `filter_aniso` to `filter_anisotropy`Yuri Roubinsky
2021-12-10Rename `hint_aniso` to `hint_anisotropy` in the shader languageHugo Locurcio
The word "anisotropy" is used in full form in BaseMaterial3D's anisotropy-related properties.
2021-12-05Remove or make verbose some debugging printsHugo Locurcio
The message about SpatialMaterial conversion was turned into a warning, as it can potentially interfere with porting projects from Godot 3.x (if there's a bug in the conversion code).
2021-11-13Set roughness/metallic to 1 when assigning a texture in BaseMaterial3DHugo Locurcio
This makes material setup faster and avoids mistakes, especially with the metallic channel which defaults to 0. The value is only changed when adding a texture when none was previously assigned, not when assigning a different texture.
2021-11-03Rename `PROPERTY_USAGE_NOEDITOR` to `PROPERTY_USAGE_NO_EDITOR`Hugo Locurcio
This is consistent with other constants that include `NO`, such as `PROPERTY_HINT_COLOR_NO_ALPHA`.
2021-10-28Merge pull request #54222 from JFonS/instance-fadeRémi Verschelde
2021-10-26Fix vulkan proximity fadeBrian Semrau
Vulkan uses different normalized device coordinates than OpenGL.
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-10-05Merge pull request #53237 from metinc/fix-animated-sprite-precision-error-masterRémi Verschelde
2021-10-04Merge pull request #53378 from clayjohn/hide_render_priorityRémi Verschelde
Hide render_priority except when using SpatialMaterials
2021-10-04Hide render_priority except when using SpatialMaterialsclayjohn
2021-10-04GDScript completion: Handle quote style ad-hoc to remove editor dependencyRémi Verschelde
`core` and `scene` shouldn't depend on `editor`, so they can't query this style setting in `get_argument_options`. But we can handle it after the fact in GDScript's completion code. Also cleans up a couple extra unused invalid includes in `core`.
2021-09-29Add half frame to floor()Metin Celik
2021-09-21Merge pull request #52466 from tcoxon/fix_43733_4.0Rémi Verschelde
Prevent shaders from generating code before the constructor finishes.
2021-09-21Prevent shaders from generating code before the constructor finishes.Tom Coxon
Fixes #43733: "creating SpatialMaterial in a separate thread creates invalid shaders (temporarily)." The bug occurred because various setters called in materials' constructors add materials to queues that are processed on the main thread. This means that when the materials are created in another thread, they can be processed on the main thread before the constructor has finished. The fix adds a flag to affected materials that prevents them from being added to the queue until their constructors have finished initialising all the members.
2021-09-20Merge pull request #52151 from CaptainProton42/fix-y-billboard-shearRémi Verschelde
Fix y billboard shear when rotating camera
2021-09-09Merge pull request #50383 from ↵Juan Linietsky
Calinou/standardmaterial3d-improve-simple-parallax Improve the appearance of simple parallax in StandardMaterial3D
2021-08-27Fix y billboard shear when rotating cameraJohn Wigg
Fixes shear effect with `BILLBOARD_FIXED_Y` when the camera is rotated around the z-axis by rotating the mesh correctly into view space. Also removes shearing effects that occur when rotating the mesh by excluding the model rotation and scale from the billboard matrix.
2021-08-16Add a comment at the top of generated shadersHugo Locurcio
This comment is useful to determine the origin of ShaderMaterials converted from built-in material types (such as CanvasItemMaterial or StandardMaterial3D). The Godot version is also included in case the shader needs to be regenerated with a newer engine version.
2021-08-13Style: Cleanup code using `text_editor/completion/use_single_quotes`Rémi Verschelde
2021-08-09Improve the appearance of simple parallax in StandardMaterial3DHugo Locurcio
This uses offset limiting to avoid distortion in the distance, and makes simple (non-deep) parallax more usable overall.
2021-07-25Use const references where possible for List range iteratorsRémi Verschelde
2021-07-23Use C++ iterators for Lists in many situationsAaron Franke
2021-07-19Use C++11 raw literals for shader code to improve readabilityHugo Locurcio
In files that have lots of branching, `\t` was replaced with a tab character instead.
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-06Fix: The ORMMaterial3D shader doesn't compile #50161Martin Krbila
2021-07-05Fix Subsurface Scatteringreduz
* Works again * Transmittance also works again * Removed the curve patamter, exp() function is good enough.
2021-07-01Use PROPERTY_USAGE_NONE instead of 0 for no property usageAaron Franke
Also use const more often.
2021-06-30Deprecate ImmediateGeometryreduz
* Removed entirely from RenderingServer. * Replaced by ImmediateMesh resource. * ImmediateMesh replaces ImmediateGeometry, but could use more optimization in the future. * Sprite3D and AnimatedSprite3D work again, ported from Godot 3.x (though a lot of work was needed to adapt them to Godot 4). * RootMotionView works again. * Polygon3D editor works again.
2021-06-28Merge pull request #49951 from ↵Rémi Verschelde
Calinou/standardmaterial3d-height-triplanar-print-warning Print warning in StandardMaterial3D when height and triplanar are active
2021-06-28Print warning in StandardMaterial3D when height and triplanar are activeHugo Locurcio
Using both height mapping and triplanar mapping isn't supported.
2021-06-27Fix flipped binormal in StandardMaterial3D triplanar mappingHugo Locurcio
This made normal maps on triplanar materials use an inverted Y direction compared to non-triplanar materials.
2021-06-19Rename `instance()`->`instantiate()` when it's a verbLightning_A
2021-06-08Removes deleted OrenNayar mode from shaders and materialsYuri Roubinsky
2021-06-07Style: Cleanup uses of double spaces between wordsRémi Verschelde
Or after punctuation. Tried to leave third-party stuff alone, unless it has been heavily modified for Godot.
2021-05-25Tweak dozens of editor property hints for consistencyHugo Locurcio
- Update Viewport MSAA property hints to match the currently exposed values. - Add some performance hints to property hints.
2021-05-14Merge pull request #48478 from brennengreen/normal-mapping-unpacked-fixRémi Verschelde
Fix refraction offset by manually unpacking normal mappings
2021-05-07Manually unpacked normal mapping to fix issue with refraction being offset ↵Brennen Green
rather than distorted.
2021-05-06Tweak CanvasItem/material sampling property hints for readabilityHugo Locurcio
The "Anisotropic" term is abbreviated as spelling it out would cause the PopupMenu to overflow the editor window when using the default inspector width.
2021-04-30Implement Particle Trailsreduz
-Enable the trails and set the length in seconds -Provide a mesh with a skeleton and a skin -Or, alternatively use one of the built-in TubeTrailMesh/RibbonTrailMesh -Works deterministically -Fixed particle collisions (were broken) -Not working in 2D yet (that will happen next)
2021-04-25fix triplanar mapping for AOStefan Boronczyk
2021-03-19Implement FLAG_UV*_USE_WORLD_TRIPLANARCaptainProton42
Implements triplanar mapping in world space for UV1 and UV2 when the respective flags are enabled.
2021-03-12Fixes small typos and grammar correctionAnshul7sp1
2021-03-02Hide extra options from various nodes if they're not enabledMichael Alexsander
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.