How to use the CubeRefractionMapping function from three
Find comprehensive JavaScript three.CubeRefractionMapping code examples handpicked from public code repositorys.
GitHub: zDawnING/MyLearnWebGL
![zDawnING profile picture](/zDawnING.png?size=40)
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");
+ 3 other calls in file
GitHub: Neticon/webgl-tests
![Neticon profile picture](/Neticon.png?size=40)
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({
+ 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 )
three.Vector3 is the most popular function in three (22341 examples)