AsoboStudio / glTF-Blender-IO-MSFS

Apache License 2.0
139 stars 28 forks source link

Color Attributes (Vertex Painting) wrong in shader #289

Open rhumbaflappy opened 9 months ago

rhumbaflappy commented 9 months ago

Current Behavior

Vertex painting in the shader is only used for Alpha manipulation... which is odd as Vertex colors have no alpha

VertexPaint

Current shader: CurrentShader

Expected Behavior

The vertex colors should be mixed or multiplied with the base color, with no use of the vertex paint alpha. This allows color tinting of vertex or face without the need for a new material. Asobo uses vertex coloring in this manner ( for example: Isafjordur_Building01). Corrected shader: CorrectedShader

Steps To Reproduce

Use vertex painting in Blender to alter the coloring of a textured object using MSFS materials. The material is unaffected, whereas material coloring should occur.

Environment

- OS:Windows11
- Blender:3.3.3
- glTF-Blender-IO-MSFS:current

Anything else?

DefaultMetalPlateCubePainted.zip CorrectedMetalPlateCubePainted.zip

rhumbaflappy commented 9 months ago

I should have stated Vertex painting has no alpha in Blender. If you use a imported BIN file with alpha in the vertex color attribute, then the alpha will get passed along to MSFS. The Alpha can be left alone, as is. You just need to mix the vertex color with the Base color as I showed above.

rhumbaflappy commented 9 months ago

CorrectedMetalPlateCubePainted.zip

Shader01

ShaderCloseUp

This actually works right. The color attributes (vertex color) is applied as the last step in the shader.

ronh991 commented 9 months ago

This issue should be flagged as an enhancement request also. I see great benefit to scenery developers with this feature. Also aircraft developers can "see" the icing, scratches, dirt and fingerprint texture blending.