Godot Version
Godot_v4.4.1-stable_win64
Question
I’m trying to build a 1:1 vertex terrain shader for both Godot and Blender (4.4.3).
In Blender, I have a Color Attribute named _MaterialID set to Vertex - Byte Color
I use this Color Attribute to vertex paint perfect RGB colors on a mesh where all vertexes are black.
In blender I have built a super simple shader to use these vertex colors, and use them as a mask for textures. All works correctly.
I exported this mesh as a GLTF:
Blender 4.4 → GLTFexport with “Use Vertex Color: Active” enabled
Custom attribute named “_MaterialID” (underscore prefix for GLTF export)
Domain: Vertex, Data Type: Byte Color
Attribute set as active before export
Colors visible correctly in Blender shader editor
Then I imported it in Godot:
Godot 4.4 import shows vertex colors correctly in Advanced Import Settings preview
Cleared import cache (deleted .godot folder)
Materials tab shows imported materials
But in the editor, no matter what I do the material stays black, and I don’t have access to the vertex colors in both the code shader editor and the visual shader editor, nor the standard material with “Vertex Color as Albedo” enabled.
As can be seen in the image below, in blender all is good, in the advanced import window all is good, but in the editor; no bueno!
Things I have tried and or verified:
Mesh Data Confirmed Present (with a custom script on the mesh, shown at bottom of text):
// Debug output proves vertex colors exist:
Has vertex colors: true
Color 87: (1.0, 0.0, 0.0, 1.0) // Red
Color 108: (0.0, 0.0, 1.0, 1.0) // Blue
Color 78: (0.0, 1.0, 0.0, 1.0) // Green
All Standard Solutions Already Tested:
StandardMaterial3D with “Vertex Color → Use As Albedo” ✓
Material Override vs Surface Material Override
Extracted materials to external files
Both shader types: ALBEDO = COLOR.rgb; and visual shader COLOR input
Unshaded materials
Ruled Out Common Issues:
NOT a Face Corner domain issue (converted to Vertex)
NOT missing underscore prefix (tried both)
NOT import cache issue (cleared .godot folder)
NOT missing “Use As Albedo” setting
NOT alpha channel issue (alpha = 1.0)
NOT custom attribute mapping issue (data appears in standard COLOR array)
I’m STUMPED! How do I get access to my custom attribute in the shaders?
extends MeshInstance3D
func _ready():
var mesh_data = mesh
if mesh_data and mesh_data.get_surface_count() > 0:
# Get the actual vertex color data
var surface_data = mesh_data.surface_get_arrays(0)
var colors = surface_data[Mesh.ARRAY_COLOR]
if colors:
print("Color count: ", colors.size())
print("First 144 colors:")
for i in min(144, colors.size()):
print("Color ", i, ": ", colors[i])
else:
print("No color array found")