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

Support for more than two UV sets #206

Open
atteneder opened this issue Jul 6, 2021 · 11 comments
Open

Support for more than two UV sets #206

atteneder opened this issue Jul 6, 2021 · 11 comments
Labels
enhancement New feature or request import Import of glTF files

Comments

@atteneder
Copy link
Owner

Although the glTF spec requires to support at least two, meshes can have more than two UV sets (TEXCOORD_1) that materials can use via texCoord. See the documentation

This is considered lowest priority, since there's no demand (zero requests) and it potentially makes the shaders more complex (or adds a significant amount of shader variants).

@atteneder atteneder added the enhancement New feature or request label Jul 6, 2021
@EricBeetsOfficial-Opuscope
Copy link
Contributor

I thought I understood that at least two texCoord were supported, but the attached model use 2 texCoord and I have a wrong rendering
forest.glb.zip
.
Screenshot 2021-11-12 at 19 29 14
.

Do i do something wrong ?

Eric

@atteneder
Copy link
Owner Author

Hi @EricBeetsOfficial-Opuscope ,

I can reproduce it...might be a bug. I'll fix it, probably next week. Which render pipeline do you use?

@EricBeetsOfficial-Opuscope
Copy link
Contributor

Unity 2021.1.20f1
Universal Render Pipeline 11.0
Platform: Editor MacOS

Thanks a lot !

@atteneder
Copy link
Owner Author

@EricBeetsOfficial-Opuscope I just pushed the fix to the main branch, so it'll be in the next release. Next time please create a dedicated issue, so things don't get mixed up. Thanks!

@atteneder atteneder added the import Import of glTF files label Dec 1, 2021
@atteneder atteneder added this to To do in glTFast development via automation Dec 1, 2021
@Takanu
Copy link

Takanu commented May 11, 2022

Given the lack of responses it would seem your bet has been vindicated, but I figured I'd make a comment as my workflow heavily relies on more than two UV layers. I use them in most of my assets to carry data that's too difficult or impossible to use Vertex Colors for such as height, position and palette maps, to be used for some more complicated shader effects.

While this plugin has better animation support than GLTFUtility I can't live with just two UV maps and will have to defer to a mix of FBX and GLTF for my current projects.

I understand that you need to prioritize and that almost all assets only need 2, I'm just sad I can't use this lovely importer right now 😅

@atteneder
Copy link
Owner Author

@Takanu Thanks for your feedback. It is duly noted and taken into consideration!

As far as I see there's two tasks to this feature:

  1. Importing all UV sets into Unity Mesh data structure
  2. Add support for UV sets 2-8 to all shaders and shader graphs

Your use case implies you're not necessarily using the glTF shaders anyway, so you'd be happy with step 1 already, right?

@Takanu
Copy link

Takanu commented May 13, 2022

@atteneder For any model where I need more than two UV maps I'd have no use for the glTF shaders and I'm not even sure how you'd create a standard set of shaders with extra UV layers. Step 1 is all I need.

@atteneder atteneder moved this from To do to Import in glTFast development Jun 1, 2022
@atteneder
Copy link
Owner Author

@zjhcloth tagging you here (from #490)

Just had a quick stab at importing up to 8 UV set meshes, and it's easy (basically done).

What's still not working is support in the glTF shaders, but if you manage to build your own shaders (or use other shaders anyways), you should be set soon.

atteneder added a commit that referenced this issue Sep 30, 2022
@Takanu
Copy link

Takanu commented Sep 30, 2022

Thanks! Can't wait to try it.

@atteneder
Copy link
Owner Author

Thanks! Can't wait to try it.

Will land in the upcoming verison 5.x. If you really can't wait, it's already pushed in the main branch. Always glad for feedback!

@daverge
Copy link

daverge commented Mar 25, 2024

i was able to use uvs from shader:
uv_MainTex, uv2_MainTex and uv3_MainTex

somehow uv1 gets "jumped over", and unity shaders do not support uv4 upward. how would i get to access these 8 uv chanels that got imported?

EDIT: if i use a vertex-fragment shader, i CAN indeed use uv4_MainTex through uv8_MainTex... Apparently surface shaders don't support more than up to uv3. So it seems i need to find a vertex-fragment shader that does... well shading :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request import Import of glTF files
Projects
Status: Runtime Loading
glTFast development
Runtime Loading
Development

No branches or pull requests

4 participants