Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imported vertex colors are incorrect #640

Open
SodiumEyes opened this issue Jul 19, 2024 · 3 comments
Open

Imported vertex colors are incorrect #640

SodiumEyes opened this issue Jul 19, 2024 · 3 comments
Assignees
Labels
Bug Issue with specific functionality not working as intended but overall plugin is working.

Comments

@SodiumEyes
Copy link

When importing a nif, the vertex colors end up lighter than they should be. This only happens on Blender 3.2.0+. On Blender 3.1, the colors are correct.

3.6
Capture

3.1
Capture2

@SodiumEyes SodiumEyes added the Bug Issue with specific functionality not working as intended but overall plugin is working. label Jul 19, 2024
@Candoran2
Copy link
Member

Could you attach the nif?

@SodiumEyes
Copy link
Author

Could you attach the nif?

potionhealthgreat.zip

@ja231c
Copy link

ja231c commented Jul 24, 2024

In older versions than 3.2 it gets imported as a vertex color.
In 3.2+ vertex color was replaced by Color Attribute and gets imported as a Color Attribute of type Vertex > Color.
If you load a pre 3.2 blend file the vertex color gets converted to a Color Attribute of Face Corner > Byte Color, not Vertex > Color.

The Byte Color ones are INT8 sRGB, the Color ones are FP32 linear.

The 3.2+ Vertex > Color one is actually the more accurate one as far as preserving the same data on export is concerned (as the vertex colors are often stored as FP32). The ones with Face Corner > Byte Color result in slightly different vertex color values on export.

Whichever is correct visually depends on the game. Both types export with same looking values, the visual difference is only in Blender.

Basically, both are correct, and incorrect, at the same time.

I don't think anything can be done about this, not without breaking anything at least, unless we are fine with the accuracy loss of Byte Color, and it being wrong for games that do use linear vertex colors (Fallout 4+, probably). Or applying the gamma correction on import and export, depending on game, which will break export for all already imported meshes (and cause a very very tiny accuracy loss), unless an option to disable the correction is added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issue with specific functionality not working as intended but overall plugin is working.
Projects
None yet
Development

No branches or pull requests

4 participants