Skip to content

baseColorTexture_ST is incorrectly set to (1, -1, 0, 1) on materials with emissive textures #57

Description

@yungtofu

After upgrading from glTFast 6.16.1 to 6.17.0 (and newer versions), some imported GLB models render with a vertically flipped Base Color texture.
The issue only occurs on materials that have an emissive texture assigned.
The emissive texture itself renders correctly.

Expected behavior

The Base Color texture should render correctly, as it does in glTFast 6.16.1.

Actual behavior

The imported material has:

baseColorTexture_ST = (1, -1, 0, 1)
emissiveTexture_ST = (1, 1, 0, 0)

Because baseColorTexture_ST.y is -1, the Base Color texture appears vertically flipped.

Changing baseColorTexture_ST manually to:

(1, 1, 0, 0)

(or simply changing the Y scale from -1 to 1) immediately fixes the rendering.

Observations

  • glTFast 6.16.1: Correct rendering
    
  • glTFast 6.17.0+: Base Color texture flipped
    
  • Only materials with an emissive texture are affected.
    
  • Materials without an emissive texture are imported correctly.
    
  • The emissive texture itself renders correctly.
    
  • Only the Base Color texture receives the incorrect UV transform.
    

Steps to reproduce

  1. Import a GLB containing a material with:
    
    • Base Color texture
    • Emissive texture
  2. Load it using glTFast 6.17.0+.
    
  3. Inspect the generated material.
    
  4. Observe that baseColorTexture_ST is (1, -1, 0, 1).
    
  5. Change baseColorTexture_ST.y from -1 to 1.
    
  6. The Base Color texture renders correctly.
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions