javascript - Can't alter offset/repeat of texture used as alphaMap -


demo:

https://dl.dropboxusercontent.com/u/123374/so-pages/20160601/index.html

the alphatexture having it's offset altered during each render. "map" property changes, "alphamap" not change. 2nd mesh's alphamap

relevant code 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 object shift offset of alphatexture changes.

actual:

transparent part stays fixed on material. however, if edit offset of texture set map property (instead of alphamap) * * able shift, seems inconsistent behavior me.

what seeing current "feature" of three.js: 1 offset/repeat pair allowed per mesh. mesh.map has priority.

for more info, see https://stackoverflow.com/a/14372235/1461008

this may changed in future allow separate offset/repeat settings per texture or per material property.

three.js r.84


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo