Skip to content

Commit caf2357

Browse files
committed
Ensure albedo texture size is available for Label3D and Sprite3D
1 parent ee4acfb commit caf2357

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

scene/3d/label_3d.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ void Label3D::_generate_glyph_surfaces(const Glyph &p_glyph, Vector2 &r_offset,
392392

393393
RS::get_singleton()->material_set_shader(surf.material, shader_rid);
394394
RS::get_singleton()->material_set_param(surf.material, "texture_albedo", tex);
395+
RS::get_singleton()->material_set_param(surf.material, "albedo_texture_size", texs);
395396
if (get_alpha_cut_mode() == ALPHA_CUT_DISABLED) {
396397
RS::get_singleton()->material_set_render_priority(surf.material, p_priority);
397398
} else {

scene/3d/sprite_3d.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ void SpriteBase3D::draw_texture_rect(Ref<Texture2D> p_texture, Rect2 p_dst_rect,
276276
}
277277
if (last_texture != p_texture->get_rid()) {
278278
RS::get_singleton()->material_set_param(get_material(), "texture_albedo", p_texture->get_rid());
279+
RS::get_singleton()->material_set_param(get_material(), "albedo_texture_size", Vector2i(p_texture->get_width(), p_texture->get_height()));
279280
last_texture = p_texture->get_rid();
280281
}
281282
if (get_alpha_cut_mode() == ALPHA_CUT_DISABLED) {

0 commit comments

Comments
 (0)