mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-07-06 14:41:11 +08:00
Fix texture base color brightness
This commit is contained in:
parent
f3c8db510f
commit
80e9fc65b1
@ -475,11 +475,14 @@ def save_glb(vertices, faces, filepath=None, metadata=None,
|
|||||||
pbr = {
|
pbr = {
|
||||||
"metallicFactor": 0.0,
|
"metallicFactor": 0.0,
|
||||||
"roughnessFactor": 0.5,
|
"roughnessFactor": 0.5,
|
||||||
"baseColorFactor": [0.22, 0.22, 0.22, 1.0],
|
"baseColorFactor": [0.22, 0.22, 0.22, 1.0], # neutral-gray fallback for bare geometry only
|
||||||
}
|
}
|
||||||
if texture_png_bytes is not None and has_uv:
|
if texture_png_bytes is not None and has_uv:
|
||||||
pbr["baseColorTexture"] = {"index": add_image_texture(texture_byte_offset, len(texture_buffer)), "texCoord": 0}
|
pbr["baseColorTexture"] = {"index": add_image_texture(texture_byte_offset, len(texture_buffer)), "texCoord": 0}
|
||||||
|
|
||||||
|
if (texture_png_bytes is not None and has_uv) or "COLOR_0" in primitive_attributes:
|
||||||
|
pbr["baseColorFactor"] = [1.0, 1.0, 1.0, 1.0]
|
||||||
|
|
||||||
if mr_png_bytes is not None and has_uv:
|
if mr_png_bytes is not None and has_uv:
|
||||||
mr_texture_index = add_image_texture(mr_byte_offset, len(mr_buffer))
|
mr_texture_index = add_image_texture(mr_byte_offset, len(mr_buffer))
|
||||||
pbr["metallicRoughnessTexture"] = {"index": mr_texture_index, "texCoord": 0}
|
pbr["metallicRoughnessTexture"] = {"index": mr_texture_index, "texCoord": 0}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user