Albedo Texture Showing Color Only

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By plambrecht

I am changing/adding an albedo texture to a spatial material, which appears to be working, however instead of showing the texture, it is displaying a color that is an average color of the texture. The following is my code:

func _on_Button_pressed():
    var image = load("res://images/texture_wood_01.jpg")
    var mesh = get_node("/root/Standard_d20/D20/MeshInstance")
    var material = mesh.get_surface_material(0)
    material.albedo_texture = image
    material.albedo_color = Color(1,1,1,0)
    mesh.set_surface_material(0, material)

The MeshInstance is an .OBJ file that was loaded in. It does not appear to be an issue if I am using Godot’s meshes.

I get the same result when setting this in the inspector as well. :frowning:

The image below shows on the left what I am seeing and on the right is the texture that it is using.

Here is an image of what I am seeing

:bust_in_silhouette: Reply From: plambrecht

It appears that my 3D models did not have their UV unwrapped. Was able to go into Blender and fix this.