I tried to create my own GLSL script by extending shaders in ShaderLib (e.g. ShaderLib.basic), but unfortunately bumped into some transparency problems:
In the picture below, it looks normal by using MeshBasicMaterial directly.
var material = new THREE.MeshBasicMaterial( params ); // color and opacity are set in params
but when I used ShaderMaterial, "some" furnitures inside are invisible from outside of window (that's a weird part ...),
var myShader = THREE.ShaderLib.basic;
var uniforms = THREE.UniformsUtils.clone( myShader.uniforms ); // color and opacity are set in uniforms
var material = new THREE.ShaderMaterial({
uniforms: uniforms,
vertexShader: myShader.vertexShader,
fragmentShader: myShader.fragmentShader,
transparent: true
});
by MeshBasicMaterial and by ShaderMaterial
but can still see from inside. (comparison between inside and outside by ShaderMaterial)
(The materials are used in MultiMaterial with BufferGeometry.)
Thank you.