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

Secondary UV support for the occlusion texture #64

Closed
prajwalshettydev opened this issue Mar 19, 2020 · 4 comments
Closed

Secondary UV support for the occlusion texture #64

prajwalshettydev opened this issue Mar 19, 2020 · 4 comments

Comments

@prajwalshettydev
Copy link

prajwalshettydev commented Mar 19, 2020

Hi thanks for the amazing plugin. I understand that this is more of a feature request than an issue. So, currently, in the project I'm working on, I need to connect the Occlusion Texture using the secondary uv of the mesh instead of the primary. Please help me out since it is an urgent need. Thanks again

@prajwalshettydev
Copy link
Author

prajwalshettydev commented Mar 19, 2020

I see that you have mentioned here that the

Note: the second UV set is loaded, but no material/shader makes use

So, can you please let me know how I can do this? for eg in the glTFUnityStandardCoreForwardSimple.cginc I see that half occlusion = Occlusion(i.tex.xy); is passed, so I'm guessing I need to pass the uv2 here instead of the uv1, just not sure how exactly to. Thanks!

@prajwalshettydev
Copy link
Author

Hi, me again, managed to fix it for now by adding this
texcoord.zw = TRANSFORM_TEX(v.uv1, _OcclusionMap);
in the glTFUnityStandardInput.cginc's TexCoords(VertexInput v) fn. I will close this thread soon. Thanks for the wonderful plugin.

@atteneder
Copy link
Owner

Hi,

glad you figured out a solution that works for you. I may work on a more general solution after version 2.0, which uses the new mesh API and and some point maybe the shader graph.

@prajwalshettydev
Copy link
Author

That'd be great!

atteneder pushed a commit to Unity-Technologies/com.unity.cloud.gltfast that referenced this issue Nov 6, 2023
brownie11636 pushed a commit to brownie11636/glTFast that referenced this issue Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants