-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Import the second UV map if present in glTF files. #9992
Conversation
Oh oops, looked like I missed a spot (I was testing with a custom shader so that didn't show up). Should be fixed now. |
Conventionally, the second UV map (`TEXCOORD1`, `UV1`) is used for lightmap UVs. This commit allows Bevy to import them, so that a custom shader that applies lightmaps can use those UVs if desired. Note that this doesn't actually apply lightmaps to Bevy meshes; that will be a followup. It does, however, open the door to future Bevy plugins that implement baked global illumination.
Need to modify prepass_io.wgsl as well maybe |
I don't think so, because I didn't update the prepass vertex bindings. I didn't see any need for the prepass to have access to UV1. |
The prepass uses the same vertex buffer though, right? Idk, maybe it doesn't actually cause issues. Idk how bevy setups up the vertex attributes off the top of my head. |
Yeah, I don't think it causes any issues because the mesh attributes are referred to by name inside Bevy. |
This was a longstanding missing feature. Consider searching the bug tracker. I think there is at least a couple issues that can be closed when this gets merged. |
The prepass uses it's own vertex layout, so it doesn't need to be updated for this |
Is this limited to only uv1? As mentioned in the other ticket, exporting lightmaps from unreal seem to use several uv1 maps for reasons I don't really understand tbh (at least UV1-4) |
Conventionally, the second UV map (`TEXCOORD1`, `UV1`) is used for lightmap UVs. This commit allows Bevy to import them, so that a custom shader that applies lightmaps can use those UVs if desired. Note that this doesn't actually apply lightmaps to Bevy meshes; that will be a followup. It does, however, open the door to future Bevy plugins that implement baked global illumination. ## Changelog ### Added The Bevy glTF loader now imports a second UV channel (`TEXCOORD1`, `UV1`) from meshes if present. This can be used by custom shaders to implement lightmapping.
Conventionally, the second UV map (`TEXCOORD1`, `UV1`) is used for lightmap UVs. This commit allows Bevy to import them, so that a custom shader that applies lightmaps can use those UVs if desired. Note that this doesn't actually apply lightmaps to Bevy meshes; that will be a followup. It does, however, open the door to future Bevy plugins that implement baked global illumination. ## Changelog ### Added The Bevy glTF loader now imports a second UV channel (`TEXCOORD1`, `UV1`) from meshes if present. This can be used by custom shaders to implement lightmapping.
Conventionally, the second UV map (`TEXCOORD1`, `UV1`) is used for lightmap UVs. This commit allows Bevy to import them, so that a custom shader that applies lightmaps can use those UVs if desired. Note that this doesn't actually apply lightmaps to Bevy meshes; that will be a followup. It does, however, open the door to future Bevy plugins that implement baked global illumination. ## Changelog ### Added The Bevy glTF loader now imports a second UV channel (`TEXCOORD1`, `UV1`) from meshes if present. This can be used by custom shaders to implement lightmapping.
Conventionally, the second UV map (
TEXCOORD1
,UV1
) is used for lightmap UVs. This commit allows Bevy to import them, so that a custom shader that applies lightmaps can use those UVs if desired.Note that this doesn't actually apply lightmaps to Bevy meshes; that will be a followup. It does, however, open the door to future Bevy plugins that implement baked global illumination.
Changelog
Added
The Bevy glTF loader now imports a second UV channel (
TEXCOORD1
,UV1
) from meshes if present. This can be used by custom shaders to implement lightmapping.