godotengine / godotengine/godot

Blender/GLTF vertex coloring is wrong with OpenGL Compatibility renderer.

Open
#87,486 15 comments 3 reactions 0 assignees View on GitHub
bug topic:3d topic:rendering
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

Reproducible from Godot 4.0+.
I noticed this with 4.2.1.stable but it also happens with 4.0.stable and 4.3.dev2.
Not a regression from a prior release of Godot 4.

### System information

Godot v4.2.1.stable - macOS 14.1.1 - Vulkan (Mobile) - integrated Apple M1 Pro - Apple M1 Pro (10 Threads)

### Issue description

With the compatibility renderer, vertex colors are way darker than they should be, like there's some incorrect sRGB <-> Linear color space conversion going on or something. They appear correct with the Mobile and Forward+ renderers. I've observed this with models made in Blender at least... Here are a couple of comparisons. The wall model provided with the reproduction project I made and colored using Blender. It has no textures, just vertex colors.

Vulkan:
![Screenshot 2024-01-22 at 21 09 11](https://github.com/godotengine/godot/assets/103377610/08ccf7d7-c74a-4605-ba0c-b5d66b42cba5)
OpenGL:
![Screenshot 2024-01-22 at 21 10 14](https://github.com/godotengine/godot/assets/103377610/48518f7e-5b7d-455f-8c8a-1ed80c8cf2eb)

Vulkan:
![Screenshot 2024-01-22 at 21 11 49](https://github.com/godotengine/godot/assets/103377610/17da3025-84c3-4323-81c8-ca1061d005c2)
OpenGL (Different map position but it shows the color difference):
![Screenshot 2024-01-22 at 21 12 27](https://github.com/godotengine/godot/assets/103377610/4df7aaf9-bc83-475c-9a28-75cc9e4aeac2)

I worry that fixing this bug would be a breaking change for some users, but as it stands, vertex colors aren't very useful.

### Steps to reproduce

Open the test project in any version of Godot 4.
Observe how the coloring is different between OpenGL and Vulkan. The Vulkan colors are the correct ones, at least on my computer. Maybe it depends on OS or GPU?

### Minimal reproduction project (MRP)

[Repro_VertexColorCompatibilityRenderer.zip](https://github.com/godotengine/godot/files/14015162/Repro_VertexColorCompatibilityRenderer.zip)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.