My goal is to apply a refraction material to a sphere object. The challenge is to make the sphere transparent enough to see not only the scene background but also other 3D geometry within the scene. One possible solution is to configure the envMap
parameter using the Scene.background
method.
let scene = new THREE.Scene();
scene.background = new THREE.CubeTextureLoader().setPath( '/path/to/my/assets/' )
.load( [ 'pX.png', 'nX.png',
'pY.png', 'nY.png',
'pZ.png', 'nZ.png' ] );
let geometry = new THREE.SphereBufferGeometry( 50, 25, 15 );
let refractedMaterial = new THREE.MeshBasicMaterial( { color: 0xfffffc,
envMap: scene.background,
refractionRatio: 1.00 } );
let sphereMesh = new THREE.Mesh( geometry, refractedMaterial );
// Additionally, there are some examples of 3D text
// These 3D texts can be viewed in the scene
// However, they cannot be seen through the refractive sphere
let textMesh = new THREE.Mesh( textGeometry, textMaterial );
scene.add( sphereMesh );
scene.add( textMesh );
QUESTION:
Which parameter of
controls the visibility of the scene geometry, rather than just the scene background?MeshBasicMaterial( parameters : Object )