#Blender vertex paint .glb to Godot

183 messages · Page 1 of 1 (latest)

tawny fossil
#

I tried importing my blender vertex painted low poly terrain mesh in .obj and the coloring looks as intended in godot (just toggle true Vertex Color > Use As Albedo)

But imported in .glb, (with same option toggled) it looks messed up.

I must be missing some configuration here?

tawny fossil
#

I have reason to believe this simply isn't posible in Godot 4 yet

#

So I might have to stick to obj for now.

void bough
#

If you check the box under File>External Data>Automatically Pack Resources, then image textures will be brought from Blender into Godot without needing to have them in a separate folder in godot

#

@tawny fossil

tawny fossil
#

@void bough My terrain mesh model only uses vertex paint as texture, but it's not an actual texture, it's vertex color information which influences each face/tri of the mesh for an interpolated color it will display.

#

I've seen both the videos you shared.

#

The first one states that you can export .blend files and they work fine on Godot. Which is cool, but doesn't solve my issue. I want to export using the recommended .glb format. It's pure binary, and faster for Godot since it runs well on GPU

#

The second video is only explaining how to export a regular model with textures. That's cool, and I'll likely reference it once I get to textures 🙂 But my model is Vertex Painted.

#

My conclusion is that VertexPaint data doesn't load correclty in Godot 4+ from a .glf (or any of the other variants) with only normals and vertex coloring being exported with the mesh.

#

It will work fine with the older .obj format.

void bough
#

https://discord.com/invite/6THUkfy
Member - https://youtube.com/c/raven67854/join
Patreon - https://www.patreon.com/raven67854

In this tutorial I will show you how to make in Ambient Occlusion(AO) and Color data into a mesh from Blender and then use it inside of Godot. This can be very useful for adding extra pop to your meshes or very handy fo...

▶ Play video
#

i dont know why he makes it like this but the vertex color data he made in blender is showing up in godot

#

Common mesh you get (ArrayMesh) supports vertex color

#

@tawny fossil

tawny fossil
#

Yes I can get the vertex color to show in godot

#

he exports in obj, I do too.

#

the thing is glf is more optimal for godot, but godot still can't load vertex data from glf

#

too bad 😄

void bough
#

so the main problem is that the most optimal format can be used in godot but dont import the vertex color data

#

that sound like an bug

#

normaly every format that can be imported or exported runs like in every other programm too

#

so i would call this an bug

#

so they fix it in the next month

#

you need discribe it in much detail as you can there

#

there are coders that fix things 24/7

#

when it is an bug (what i exspect) its fixed in 4 weeks

#

it it not an bug they will provide you an solution fast

#

@tawny fossil

tawny fossil
#

I see. Well, I am obviously curious as to what is going on and why this isn't working as expected for .glf

#

The issue tracker for godot is really packed, contributers do seem to be busy 😂

#

but if you recommend it I will report this, we'll get to the bottom of it 👌

void bough
#

the issue tracker dont get cleared

#

80% of what you see there is already done

tawny fossil
#

I mean, 8k open issues 😅

void bough
#

when its confimred most of the time is needs 2 patches and its done

#

there are also 1,8k pull request with fixes

#

some need an review of an dev and than it get merged with the core programm

tawny fossil
#

issue hasn't been reported yet

void bough
#

?

#

thats from yesterday

tawny fossil
#

I don't understand what he's reporting.

#

Might be related.

void bough
#

is an bug that godot didnt accept vertex colors as default when blender importer is used

tawny fossil
#

oh is it now?

void bough
#

it might be cross your problem

tawny fossil
#

I mean usually I have to add a material override and click the "use vertex color as albedo" toggle in it.

void bough
#

i dont know anymore how the importer works and where to find its settings

tawny fossil
#

However in .glb this doesn't even work.

#

The toggle is clearly on, and the coloring looks stripey

void bough
#

stripey means most of the time some streching is going on

tawny fossil
#

This isn't how vertex color is meant to behave 😂

void bough
#

is there an option that the colory would change form ???

#

i know

tawny fossil
#

that iss... pretty much it.

#

just normals and colors

void bough
#

??

#

what do you mean

tawny fossil
#

yeah sorry that's the blender export.

#

I'm just exporting normals and colors.

#

just like with obj

#

then in godot it's a new material

#

shouldn't stretch anything.

void bough
#

wait on what project do you work i mean forward+,mobile or compatibility ?

tawny fossil
#

Compatibility for html, which I believe is the least developed.

void bough
#

but only forward+ uses all graphical benefits.....

tawny fossil
#

hm yeah, I'll try a new project with forward+

#

let's see

void bough
#

pls

tawny fossil
#

yeah same issue with forward+

void bough
#

ok

void bough
# tawny fossil

wait this is the picture how its look in godot right ? can i see how its look in blender pls ?

tawny fossil
void bough
#

? its the same

tawny fossil
#

yes

void bough
#

did i miss something ?

#

both look the same

tawny fossil
void bough
#

the .obj is ok its just an light problem

tawny fossil
void bough
#

but you want the .gbl

tawny fossil
#

Exactly.

#

afaik I've been recommended to use .glb multiple times, and would go on using it for vertex paint if posible.

#

nice axolotl pfp btw. Are you making an axolotl game by any chance?

void bough
#

ok try in blender triangulating your meshes before exporting

tawny fossil
#

alright.

#

Is this what you mean?

void bough
#

yes

tawny fossil
#

I'll now export and import as glf

void bough
#

with the color pls

#

i mean the blender view dont shows it

tawny fossil
#

indeed, the color looks... fine 😂 triangulated in blender.

#

not the finest work of art but still a good example

#

godot forward+ still stripey

void bough
#

shit

tawny fossil
#

the stripes shifted a bit.

#

but yeah

#

material autogenerates

#

with use vertexpaint as albedo

#

but it's messed up

void bough
#

maybe its an position problem

#

because the colors are correct

#

but not the y,z and x cordinates

void bough
#

Warning

If your model contains blend shapes (also known as "shape keys" and "morph targets"), your glTF export setting Export Deformation Bones Only needs to be configured to Enabled under the Animation export configurations.

Exporting non-deforming bones anyway will lead to incorrect shading.

Note

Blender versions older than 3.2 do not export emissive textures with the glTF file. If your model uses one and you're using an older version of Blender, it must be brought in separately.

By default, Blender has backface culling disabled on materials and will export materials to match how they render in Blender. This means that materials in Godot will have their cull mode set to Disabled. This can decrease performance since backfaces will be rendered, even when they are being culled by other faces. To resolve this, enable Backface Culling in Blender's Materials tab, then export the scene to glTF again.

#

Blender 3.4 and later can export RGB vertex colors in OBJ files (this is a nonstandard extension of the OBJ format). Godot is able to import those vertex colors since Godot 4.0, but they will not be displayed on the material unless you enable Vertex Color > Use As Albedo on the material.

Vertex colors from OBJ meshes keep their original color space once imported (sRGB/linear), but their brightness is clamped to 1.0 (they can't be overbright).

tawny fossil
#

but they will not be displayed on the material unless you enable Vertex Color > Use As Albedo on the material.
ok. That's how I do it for .obj

void bough
#

as i said make your own bug report and explain it

tawny fossil
#

that is my own

void bough
#

this cant be normal

#

ah ok

#

but i like your approach

#

you make an 3d model without any texture

tawny fossil
#

it's perfect for low poly

#

the color is interpolated

void bough
#

that means also you cant use any pattern generator, or brush effect

#

you can only use colors and an blend method and you can only color specific parts

#

its a little bit like pixelart

#

wouldnt be pixelart textures as gif in only 4bit colors have the same effect on the performance ?

#

or are there other problems later in the game itself for the look or performance ?

tawny fossil
#

There also seems to be a lighting calculation that goes per vertex and not per pixel somewhere, can't remember where it was, do you (currently unavailable, at least for compatibility)? If they fixed that it looks like it could be perfect for low poly layouts.

#

This is my level 1

tawny fossil
#

I also read glb trims out information and runs really smooth on gpu, so the recommendation makes sense.

#

but yeah I also have some performance issues being a game html and such, but mainly collision/physics-wise. Every little helps.

void bough
#

then why not use defold engine its made for mobile and html

tawny fossil
#

I really wanted to try out godot 😂

#

so I made a small project for testing, and I also wanted it easy to share.

#

open source, royalty free... it all sound very sexy.

#

but yeah, coming from Unity, I do see it is relatively underdeveloped.

void bough
#

ok we should wait what they say to your bug report

tawny fossil
#

It got an answer but idk where vertex compression is, to try to disable it.

#

does the same with generate lod's off as suggested.

void bough
#

left down

#

and In Godot, Level of Detail (LOD) versions are generated automatically on import and work almost transparently with the default settings. If you want to disable LOD generation, you might need to do it manually in your 3D modelling tool before importing the model into Godot. As of now, there doesn't seem to be a direct option in Godot's import settings to disable automatic LOD generation.

tawny fossil
#

Oh yeah, so it was already disabled.

void bough
#

lod is on the blender part for the export

tawny fossil
#

I disabled this one from Godot and hit reimport.

void bough
#

i am afk until tomorrow

void bough
#

i am at work now

void bough
#

so i am back

tawny fossil
#

This appears solved. Either the export randomly works when starting a new blender file, or the following worked: I found what appears to be a exporter code update for an upcoming release. I copy-pasted it into the add-on folder. Started blender, imported my model, exported as .glb with default settings with only the Y-transform deactivated. Object showed up correctly.

#

Interesting, thanks for finding this.

#

Maybe updating blender or using an older version 🤔

void bough
#

update it

#

blender devs are good in fixing

#

when this works and you can do what you wanted , pls when you see someone here in the future with similar problems just show him your solution too

tawny fossil
#

Blender 3.4 had a bug exporting .glb which seems fixed in 3.6

#

furthermore, exporting .glb you don't even need to add a material to the mesh. Surface0 shows a preexisting material with use vertex paing as albedo setting already toggled true.

void bough
#

soooooooooooo it works ?

#

@tawny fossil

tawny fossil
#

Yes!

#

as long as you export with latest blender version.

void bough
#

great

#

so no bug in godot

#

👍

tawny fossil
#

nope.

#

except for that material thing you sent me before.

#

I noticed that too.

void bough
#

hmmm

tawny fossil
#

not a huge issue though. I'm more intrigued about:

#

Where is the default generated material in a .glb saved?

#

Because it autogenerates one in layer0, but I never exported it from blender.

void bough
#

When you import a .glb file in Godot, the materials are stored within the .glb file itself1. If you want to edit these materials, you need to create a new inherited scene from your .glb file2.

Here’s how you can do it:

Right-click your .glb file in the FileSystem dock.
Select “New Inherited”.
Open the newly created scene.

Now, you should be able to see and edit the materials in the Inspector2. Please note that any changes you make will be saved to the inherited scene, not the original .glb file2.

#

i ask bing chat