Problems with lightmap textures,lightmap is mapped to the second set of uv?

The external import model has two sets of uv, uv is for storing texture, uv2 is for storing lighting information, how should I store lightmap on uv2;code show as below

use meshPhysicalMaterial then child.emissiveMap = "lightMap.jpg" ; and set child.emissiveIntensity = 75 ; that should make ur material emit light.

The modeler stores the light and shadow information in lightmap.jpg. The lighting is normal, but three pastes the material into uv1 by default. My requirement is to paste the material into uv2.

u can copy the material from uv1 to uv2

Yes uv2 for lightMap. Here is custom shader used.
image

I’m a beginner, can you provide some demo reference?

I can explaine. Into 3ds max i export model with default UV to OBJ format.
Than in 3ds max make flatten UV for lightmap, bake lightmap and export to OBJ format.
In three.js load default model. then load second model which contain UV lightmap and set this UV lightmap to uv2 of default model. Second model not need to add to scene.
mesh_1.geometry.setAttribute('uv2',new THREE.Float32BufferAttribute(mesh_2.geometry.attributes.uv.array,2));

2 Likes

Thank you, I made a uv error when I converted the fbx model to the glb model, which caused the problem

Thank you, I made a uv error when I converted the fbx model to the glb model, which caused the problem, thank you very much