demo:
the alphaTexture
is being modified in its offset with each render. When used as a "map" property, the offset changes, but when used as an "alphaMap" it remains static. This issue arises with the second mesh's alphaMap.
relevant code from demo link:
var colorTexture = new THREE.TextureLoader().load('blue.png')
, alphaTexture = new THREE.TextureLoader().load('alpha.png')
, offset = 0
, colorFill = new THREE.Mesh(
new THREE.Geometry(),
new THREE.MeshPhongMaterial({
map: colorTexture,
alphaMap: alphaTexture,
side: THREE.DoubleSide,
shading: THREE.FlatShading
})
)
function render() {
requestAnimationFrame(render)
offset += .01
alphaTexture.offset.x = Math.sin(offset)
renderer.render(scene, camera)
}
render()
expected:
the transparent part of the object should move as the alphaTexture offset changes.
actual:
the transparent part remains fixed on the material. However, if I adjust the offset of the texture assigned to the map
property (instead of alphaMap
), it does shift. This inconsistency in behavior is puzzling to me.