Numid
Numid

Reputation: 551

Lightmap texture tiling with Three.js

I know about texture tiling. However can a lightmap be tiled the same way?

I can't manage to tile a lightmap texture using the following snippet of code. No repeat or offset is taken into account.

var map = THREE.ImageUtils.loadTexture('Map.jpg');
var lightMap = THREE.ImageUtils.loadTexture('Light map.png');
lightMap.wrapS = lightMap.wrapT = THREE.RepeatWrapping;
lightMap.repeat.set(.455078, .455078);
lightMap.offset.set(.472343, .546562);
var material = new THREE.MeshLambertMaterial({map: map, lightMap: lightMap});
jsonLoader.load('Model.json', function (geometry) {
  var mesh = new THREE.Mesh(geometry, material);
  scene.add(mesh);
});

Thank you for your help.

Upvotes: 0

Views: 866

Answers (1)

WestLangley
WestLangley

Reputation: 104783

Lightmaps do not support offset/repeat in three.js, and in fact require a separate set of UVs.

three.js r.69

Upvotes: 2

Related Questions