Three.Js draw linear gradient texture in webgl

前端 未结 1 901
被撕碎了的回忆
被撕碎了的回忆 2020-12-18 05:37

With canvas renderer, I am using a function that draws a linear gradient. I would like this to work with the webgl renderer as well, but it chokes on transparency. The cod

相关标签:
1条回答
  • 2020-12-18 06:09

    For WebGLRenderer, you need to set material.transparent = true.

    var material = new THREE.MeshBasicMaterial( { map: texture, transparent: true } );
    

    Updated fiddle: http://jsfiddle.net/FtML5/3/

    three.js r.62

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