I’m looking for some insight on utilizing light maps and/or ao maps in models I process. I’m using @react-three/gltfjsx to upload my .glb models, in case that has anything to do with this issue I’m trying to resolve. I’m going to try and give my understanding of light map requirements from the research I’ve been doing, but please do correct me if I’m wrong anywhere in my synopsis.
1.] I understand loading a texture into .lightMap / .aoMap requires using TextureLoader; I can’t just export my .glb with a second material and have it be magically applied on upload.
2.] I understand they need to be applied to a second set of UVs.
3.] I understand they use the second set of UVs in an imported model.
But I’m really struggling to find any example code or documentation showing how to apply/assign the loaded texture inside the .lightMap / .aoMap channels to the second set of UVs in an imported model.
The ultimate goal is to tile a texture in the .map channel with the first UV set, then overlay the texture in the .lightMap / .aoMap channel with the second UV set.
I can’t even get it to work with three.js editor by uploading my textures using the gui. Is there some important insight I’m missing? Is there more to it than just texture loading .lightMap to a meshStandardMaterial ?
Providing a .zip folder with the .glb model, textures, native cinema 4d file, and a screenshot showing my attempt at loading the light map into the three.js editor
Thanks for your reply! I understand how to export 2 UVs, but how are you getting the texture to load in and apply to the second UV? Are you exporting your second scene with a lightmap texture? and in what channel are you loading it into? Do you have any example code?
Were you ever able to find a solution to this? I am currently trying to figure this out myself. Would like to have a color map that then has a lightmap overlay ontop of it.