How to use the CubeRefractionMapping function from three

Find comprehensive JavaScript three.CubeRefractionMapping code examples handpicked from public code repositorys.

121
122
123
124
125
126
127
128
129
130
materialFolder.add(materialContr, 'switchEnvMapType', ['reflection', 'refraction']).onChange(function(type){
        if(type == 'reflection'){
                envMapSphere.material.envMap.mapping = THREE.CubeReflectionMapping;
        }
        if(type == 'refraction'){
                envMapSphere.material.envMap.mapping = THREE.CubeRefractionMapping;
        }
        envMapSphere.material.needsUpdate = true;
})
// let fresnalMaterial = materialFolder.addFolder("Fresnel Material");
fork icon0
star icon0
watch icon1

+ 3 other calls in file

36
37
38
39
40
41
42
43
44
45

const lightHelper = new THREE.DirectionalLightHelper(directionalLight)
// scene.add(lightHelper)
const cubeCamera = new THREE.CubeCamera(1, 5, 2 ** 10)
cubeCamera.renderTarget.texture.minFilter = THREE.LinearMipMapLinearFilter
cubeCamera.renderTarget.texture.mapping = THREE.CubeRefractionMapping


const sphereGeo = new THREE.SphereGeometry(1, 64, 64)
const sphereMat = new THREE.MeshPhongMaterial({
fork icon0
star icon0
watch icon4

+ 5 other calls in file

72
73
74
75
76
77
78
79
80
81
    vrDisplay.depthNear,
    vrDisplay.depthFar
)

refractSphereCamera = new THREE.CubeCamera( 0.1, 5000, 512 )
    // refractSphereCamera.renderTarget.mapping = new THREE.CubeRefractionMapping()
scene.add( refractSphereCamera )
    
var shader = THREE.FresnelShader
var uniforms = THREE.UniformsUtils.clone( shader.uniforms )
fork icon0
star icon0
watch icon1

Other functions in three

Sorted by popularity

function icon

three.Vector3 is the most popular function in three (22341 examples)