不知道这是否可能,但是在three.js中使用ShaderToon.js,有没有让uBaseColor值透明???并使 uLineColor 值不透明?
function createShaderMaterial( id, light, ambientLight ) {
var shader = THREE.ShaderToon[ id ];
var u = THREE.UniformsUtils.clone( shader.uniforms );
var vs = shader.vertexShader;
var fs = shader.fragmentShader;
var material = new THREE.ShaderMaterial( { uniforms: u, vertexShader: vs, fragmentShader: fs } );
material.uniforms.uDirLightPos.value = light.position;
material.uniforms.uDirLightColor.value = light.color;
material.uniforms.uAmbientLightColor.value = ambientLight.color;
return material;
}
geometry = new THREE.TorusKnotGeometry(106.68, 200, 12, 2, 8.44, 5.4, 1);
material = createShaderMaterial( "dotted", directionalLight, ambientLight );
material.uniforms.uBaseColor.value.setHex( 0xffffff ); // want this to be transparent
material.uniforms.uLineColor1.value.setHex( 0x0000 );
mesh = new THREE.Mesh(geometry, material);
scene.add(mesh);