colors - Anyway to make the uBaseColor value transparent? Three.js && ShaderToon.js -


don't know if possible, using shadertoon.js in three.js, there anyway make ubasecolor value transparent??? , leave ulinecolor value opaque?

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 transparent material.uniforms.ulinecolor1.value.sethex( 0x0000 ); mesh = new three.mesh(geometry, material); scene.add(mesh); 

shadertoon part of examples, free modify liking.

for example, this:

"gl_fragcolor = vec4( ubasecolor, 0.5 );", 

in createshadermaterial() function, have set

material.transparent = true; 

three.js r.59


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -