[Solved] Dark textures on 3D models

Hello, I ran into the following problem - the textures of 3D models are displayed much darker than they should. Here is an example, on the left are 3D boxes (they have correct colors) , on the right are 3D models that have been assigned the same PNG textures.

I’ve tried exporting materials with different color space and export settings, but none of them worked. I also tried adding Ambient Light to the scene and changing the Material Modifier settings, this also did not work. Is there a way to somehow keep the original colors on the textures? Thank you.

1 Like

Thanks for this interesting analysis! We’ll look into it. Could you maybe send your test project over so that we can quickly get into it?

Google Drive Folder. project file, 2 textures and 2 glb models from my example above.
I can upload them somewhere else if needed.

I have a same problem, I have tried several shaders (principled bsdf, glTF 2.0) in blender but nothing changes. The model work fine in glTF Viewer, I don’t see how to proceed, thank you.

Hello, as far as I understand, nothing can be done about it yet. It seems that Gdevelop somehow does not correctly display the color space of the texture, linear instead of sRGB, or something like that, I do not understand this, but some people had the similar issue in other applications.

I tried to find temporary solutions to at least have a rough idea of ​​​​how the game looks, but to no avail, the textures are too far from the original anyway. So for now we just have to wait.

I’m not sure that’s a trivial issue: three.js docs
It looks like the loader we use to load glTF files sets the textures with a sRGB encoding although we use a linear encoding everywhere else.
Still looking into it.

This bug should be fixed with Fix color encoding of glb models by AlexandreSi · Pull Request #5368 · 4ian/GDevelop · GitHub
It will be available in the next release.
Thanks you for taking the time to report this and for your analysis that allowed a quick fix!

1 Like

Great, thanks for the quick fix.

Thanks you 7ToGo and alexandresi, can’t wait to test :slightly_smiling_face:

Thanks to the Gdevelop team first of all. I think this bug would have been found sooner or later without me. I have already actively tested the use of GLTF models, if you can work in 3D and bake specular and light maps onto textures, you can even imitate triple-A graphics. These new 3D features that have been introduced since the Pandako extension are definitely a big step for Gdevelop, I think it will attract a lot of new developers in the near future.

1 Like

And if they ever add convenient animation support for GLTF similar to what Gdevelop has for regular sprites now, and lets say grid-based pathfinding for 3D environments, oh boy… the options are endless.

1 Like

You can actually already use pathfinding on 3d environments. Just x and y, but never the less, if you need a character or vehicle etc to move around, it works fine. Collision detection also works remarkably well.