Lightmaps in Three.js

后端 未结 1 1126
旧巷少年郎
旧巷少年郎 2021-01-28 13:15

Lightmaps live independently of other textures, right?

So I have to set up a second set of UVs.

I have exported my JSON object with a second set of UVs and added

相关标签:
1条回答
  • 2021-01-28 14:03

    Lightmaps in three.js require a second set of UVs. One solution is to add a second set of UVs by duplicating the first set.

    For THREE.Geometry you can do this:

    geometry.faceVertexUvs[ 1 ] = geometry.faceVertexUvs[ 0 ];
    

    For THREE.BufferGeometry, use this pattern;

    var uvs = geometry.attributes.uv.array;
    geometry.addAttribute( 'uv2', new THREE.BufferAttribute( uvs, 2 ) );
    

    three.js r.73

    0 讨论(0)
提交回复
热议问题