diff --git a/scene/resources/fog_material.cpp b/scene/resources/fog_material.cpp index aabaa54505b..5e4f1970ee8 100644 --- a/scene/resources/fog_material.cpp +++ b/scene/resources/fog_material.cpp @@ -82,7 +82,7 @@ float FogMaterial::get_edge_fade() const { void FogMaterial::set_density_texture(const Ref &p_texture) { density_texture = p_texture; - RID tex_rid = p_texture.is_valid() ? p_texture->get_rid() : RID(); + Variant tex_rid = p_texture.is_valid() ? Variant(p_texture->get_rid()) : Variant(); RS::get_singleton()->material_set_param(_get_material(), "density_texture", tex_rid); } diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 8ebfd887700..4999e2e5d4f 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -1914,7 +1914,7 @@ void BaseMaterial3D::set_texture(TextureParam p_param, const Ref &p_t ERR_FAIL_INDEX(p_param, TEXTURE_MAX); textures[p_param] = p_texture; - RID rid = p_texture.is_valid() ? p_texture->get_rid() : RID(); + Variant rid = p_texture.is_valid() ? Variant(p_texture->get_rid()) : Variant(); RS::get_singleton()->material_set_param(_get_material(), shader_names->texture_names[p_param], rid); if (p_texture.is_valid() && p_param == TEXTURE_ALBEDO) { diff --git a/scene/resources/particle_process_material.cpp b/scene/resources/particle_process_material.cpp index 476ef67a57e..d6a78cb43fc 100644 --- a/scene/resources/particle_process_material.cpp +++ b/scene/resources/particle_process_material.cpp @@ -1118,7 +1118,7 @@ void ParticleProcessMaterial::set_param_texture(Parameter p_param, const Refget_rid() : RID(); + Variant tex_rid = p_texture.is_valid() ? Variant(p_texture->get_rid()) : Variant(); switch (p_param) { case PARAM_INITIAL_LINEAR_VELOCITY: { @@ -1201,7 +1201,7 @@ Color ParticleProcessMaterial::get_color() const { void ParticleProcessMaterial::set_color_ramp(const Ref &p_texture) { color_ramp = p_texture; - RID tex_rid = p_texture.is_valid() ? p_texture->get_rid() : RID(); + Variant tex_rid = p_texture.is_valid() ? Variant(p_texture->get_rid()) : Variant(); RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->color_ramp, tex_rid); _queue_shader_change(); notify_property_list_changed(); @@ -1213,7 +1213,7 @@ Ref ParticleProcessMaterial::get_color_ramp() const { void ParticleProcessMaterial::set_color_initial_ramp(const Ref &p_texture) { color_initial_ramp = p_texture; - RID tex_rid = p_texture.is_valid() ? p_texture->get_rid() : RID(); + Variant tex_rid = p_texture.is_valid() ? Variant(p_texture->get_rid()) : Variant(); RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->color_initial_ramp, tex_rid); _queue_shader_change(); notify_property_list_changed(); @@ -1256,19 +1256,19 @@ void ParticleProcessMaterial::set_emission_box_extents(Vector3 p_extents) { void ParticleProcessMaterial::set_emission_point_texture(const Ref &p_points) { emission_point_texture = p_points; - RID tex_rid = p_points.is_valid() ? p_points->get_rid() : RID(); + Variant tex_rid = p_points.is_valid() ? Variant(p_points->get_rid()) : Variant(); RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_texture_points, tex_rid); } void ParticleProcessMaterial::set_emission_normal_texture(const Ref &p_normals) { emission_normal_texture = p_normals; - RID tex_rid = p_normals.is_valid() ? p_normals->get_rid() : RID(); + Variant tex_rid = p_normals.is_valid() ? Variant(p_normals->get_rid()) : Variant(); RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_texture_normal, tex_rid); } void ParticleProcessMaterial::set_emission_color_texture(const Ref &p_colors) { emission_color_texture = p_colors; - RID tex_rid = p_colors.is_valid() ? p_colors->get_rid() : RID(); + Variant tex_rid = p_colors.is_valid() ? Variant(p_colors->get_rid()) : Variant(); RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_texture_color, tex_rid); _queue_shader_change(); }