feat: updated engine version to 4.4-rc1
This commit is contained in:
parent
ee00efde1f
commit
21ba8e33af
5459 changed files with 1128836 additions and 198305 deletions
|
|
@ -44,6 +44,20 @@ void Decal::set_texture(DecalTexture p_type, const Ref<Texture2D> &p_texture) {
|
|||
ERR_FAIL_INDEX(p_type, TEXTURE_MAX);
|
||||
textures[p_type] = p_texture;
|
||||
RID texture_rid = p_texture.is_valid() ? p_texture->get_rid() : RID();
|
||||
|
||||
#ifdef DEBUG_ENABLED
|
||||
if (p_texture.is_valid() &&
|
||||
(p_texture->is_class("AnimatedTexture") ||
|
||||
p_texture->is_class("AtlasTexture") ||
|
||||
p_texture->is_class("CameraTexture") ||
|
||||
p_texture->is_class("CanvasTexture") ||
|
||||
p_texture->is_class("MeshTexture") ||
|
||||
p_texture->is_class("Texture2DRD") ||
|
||||
p_texture->is_class("ViewportTexture"))) {
|
||||
WARN_PRINT(vformat("%s cannot be used as a Decal texture (%s). As a workaround, assign the value returned by %s's `get_image()` instead.", p_texture->get_class(), get_path(), p_texture->get_class()));
|
||||
}
|
||||
#endif
|
||||
|
||||
RS::get_singleton()->decal_set_texture(decal, RS::DecalTexture(p_type), texture_rid);
|
||||
update_configuration_warnings();
|
||||
}
|
||||
|
|
@ -163,10 +177,10 @@ void Decal::_validate_property(PropertyInfo &p_property) const {
|
|||
}
|
||||
|
||||
PackedStringArray Decal::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
PackedStringArray warnings = VisualInstance3D::get_configuration_warnings();
|
||||
|
||||
if (OS::get_singleton()->get_current_rendering_method() == "gl_compatibility") {
|
||||
warnings.push_back(RTR("Decals are only available when using the Forward+ or Mobile rendering backends."));
|
||||
warnings.push_back(RTR("Decals are only available when using the Forward+ or Mobile renderers."));
|
||||
return warnings;
|
||||
}
|
||||
|
||||
|
|
@ -225,10 +239,12 @@ void Decal::_bind_methods() {
|
|||
ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "size", PROPERTY_HINT_RANGE, "0,1024,0.001,or_greater,suffix:m"), "set_size", "get_size");
|
||||
|
||||
ADD_GROUP("Textures", "texture_");
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "texture_albedo", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_texture", "get_texture", TEXTURE_ALBEDO);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "texture_normal", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_texture", "get_texture", TEXTURE_NORMAL);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "texture_orm", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_texture", "get_texture", TEXTURE_ORM);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "texture_emission", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_texture", "get_texture", TEXTURE_EMISSION);
|
||||
// Only allow texture types that display correctly.
|
||||
const String texture_hint = "Texture2D,-AnimatedTexture,-AtlasTexture,-CameraTexture,-CanvasTexture,-MeshTexture,-Texture2DRD,-ViewportTexture";
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "texture_albedo", PROPERTY_HINT_RESOURCE_TYPE, texture_hint), "set_texture", "get_texture", TEXTURE_ALBEDO);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "texture_normal", PROPERTY_HINT_RESOURCE_TYPE, texture_hint), "set_texture", "get_texture", TEXTURE_NORMAL);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "texture_orm", PROPERTY_HINT_RESOURCE_TYPE, texture_hint), "set_texture", "get_texture", TEXTURE_ORM);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "texture_emission", PROPERTY_HINT_RESOURCE_TYPE, texture_hint), "set_texture", "get_texture", TEXTURE_EMISSION);
|
||||
|
||||
ADD_GROUP("Parameters", "");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "emission_energy", PROPERTY_HINT_RANGE, "0,16,0.01,or_greater"), "set_emission_energy", "get_emission_energy");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue