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

Bug: Collada uvs from channels a,b,c are imported into Assimp channels 0,1,2. #5632

Open
StepanHrbek opened this issue Jun 21, 2024 · 0 comments · May be fixed by #5636
Open

Bug: Collada uvs from channels a,b,c are imported into Assimp channels 0,1,2. #5632

StepanHrbek opened this issue Jun 21, 2024 · 0 comments · May be fixed by #5636
Labels
Bug Global flag to mark a deviation from expected behaviour

Comments

@StepanHrbek
Copy link
Contributor

Describe the bug
Collada: Now that we properly import uv channel numbers used by textures (merged today), it becomes apparent that second half of problem is importing data into correct uv channels. We properly find out that mesh contains data in channels a, b and c (example). But then d6aacef changes a,b,c to 0,1,2 and we store data into wrong uv channels.

To Reproduce
Steps to reproduce the behavior:

  1. Import and render .dae with texture mapped mesh that uses uv channel 1.
  2. See that render is wrong, material wants data from channel 1 but data are stored in channel 0.

Expected behavior
Collada files should be imported with original uv channel numbers in both meshes and materials.

Additional context
I have problem locally fixed by reverting "empty slots are not allowed" paragraph of d6aacef,
I'll send patch.
I'll also document that empty slots in mTextureCoords are ok... are they?
Also, I don't use GetNumUVChannels(), but I see it's implemented wrong. If we allow empty slots, it needs small fix.
Finally, I'm concerned about .dae files that contain channel numbers higher than AI_MAX_NUMBER_OF_TEXTURECOORDS. Do they exist? Are they common? (My approach in LightsprintSDK was to make array of channels resizable, so I never had to figure out how large numbers exist in wild.)

@StepanHrbek StepanHrbek added the Bug Global flag to mark a deviation from expected behaviour label Jun 21, 2024
@StepanHrbek StepanHrbek changed the title Bug: Collada uvs from channels a,b,c are imported into channels 0,1,2. Bug: Collada uvs from channels a,b,c are imported into Assimp channels 0,1,2. Jun 21, 2024
StepanHrbek added a commit to StepanHrbek/assimp that referenced this issue Jun 24, 2024
…rds are renumbered to avoid empty slots.
@StepanHrbek StepanHrbek linked a pull request Jun 24, 2024 that will close this issue
StepanHrbek added a commit to StepanHrbek/assimp that referenced this issue Jun 26, 2024
…rds are renumbered to avoid empty slots.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Global flag to mark a deviation from expected behaviour
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant