summaryrefslogtreecommitdiff
path: root/scene/resources/material.cpp
AgeCommit message (Collapse)Author
2022-06-20Clean up Hash Functionsreduz
Clean up and do fixes to hash functions and newly introduced murmur3 hashes in #61934 * Clean up usage of murmur3 * Fixed usages of binary murmur3 on floats (this is invalid) * Changed DJB2 to use xor (which seems to be better)
2022-06-14Merge pull request #62042 from ↵Rémi Verschelde
Calinou/basematerial3d-nearest-height-always-linear Always sample the heightmap with linear filtering in BaseMaterial3D
2022-06-14Always sample the heightmap with linear filtering in BaseMaterial3DHugo Locurcio
Nearest-neighbor filtering of the heightmap results in a broken appearance, with and without Deep Parallax enabled on the material. Linear filtering results in a more expected appearance. This does not affect other texture maps such as albedo, normal or roughness.
2022-06-14Add Vector2/3 linking to more propertiesFireForge
- Camera2D.zoom - CanvasLayer.scale - ParallaxBackground.scroll_base_scale - ParallaxLayer.motion_scale - Polygon2D.texture_scale - BaseMaterial3D.uv1_scale - BaseMaterial3D.uv2_scale
2022-06-11Add suffixes to all nodes and resourcesFireForge
2022-05-24Rename BaseMaterial3D properties to use fully spelled out "texture"Hugo Locurcio
This is more consistent with other BaseMaterial properties such as `ao_texture_channel`. This also improves the documentation related to `albedo_texture_force_srgb`. This also fixes a typo in the 3.x material converter.
2022-05-24Merge pull request #60803 from Chaosus/shader_hint_renameRémi Verschelde
Rename `hint_albedo`, `hint_white/black` in shaders
2022-05-16Add basic lighting to GLES3 renderer.clayjohn
This includes all three light types and IBL, but does not include shadows or any form of GI
2022-05-16Replace most uses of Map by HashMapreduz
* 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!
2022-05-09Rename `hint_albedo`, `hint_white/black` in shadersYuri Roubinsky
2022-05-05Make `{call,set,notify}_group()` immediate by defaultHugo Locurcio
This results in less surprising behavior out of the box. Internal usages were modified to keep the existing behavior identical there.
2022-04-28Implement placeholder assetsreduz
* Placeholder textures * Placeholder meshes * Placeholder material This PR is the first step towards implementing https://github.com/godotengine/godot-proposals/issues/2756 It adds an asset type that uses no resources, which can be used to replace the existing ones on export for using on the upcoming server export.
2022-04-22Implement Label3D node.bruvzg
Add "generate_mipmap" font import option. Add some missing features to the Sprite3D. Move BiDi override code from Control to TextServer. Add functions to access TextServer font cache textures. Add MSDF related flags and shader to the standard material. Change standard material cache to use HashMap instead of Vector.
2022-03-18Rename several transform built-ins in shadersYuri Roubinsky
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-22Use Filament specular models and parametrizationclayjohn
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.