See the test-multi.js for a full example.
You need to specify multipage: true
at creation time:
var geom = createText({
multipage: true,
text: 'foobar'
})
You also need to make sure your BMFont tool is exporting the pages
field correctly.
This module exports shaders/multipage
for convenience. Options:
textures
an array of textures parallel to thepages
specified in your BMFont file(s)opacity
the opacity, default 1.0color
the color to tint the text, default 0xffffff
This will generate a new shader with N number of texture samplers. Some devices may not support 8 or more active textures.
var Shader = require('three-bmfont-text/shaders/multipage')
var material = new THREE.ShaderMaterial(Shader({
textures: fontAtlasPages,
opacity: 0.25,
color: 0xff0000
}))