About
Day:
#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Artists
Login
Christina Cushing
Instagram:
@christina_cushing
Day 6
The Spare Room v.62 poster version 2
Day 5
bake test 1
Day 4
- Baking materials in blender: https://docs.blender.org/manual/en/dev/render/cycles/baking.html - https://sketchfab.com/ - https://marmoset.co/ - https://www.soft8soft.com/verge3d/
List of sites to research
Day 3
<!DOCTYPE html> <html lang="en"> <head> <title>three.js webgl - glTF loader</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> <link type="text/css" rel="stylesheet" href="main.css"> </head> <body> <script type="module"> import * as THREE from '../build/three.module.js'; import Stats from './jsm/libs/stats.module.js'; import { OrbitControls } from './jsm/controls/OrbitControls.js'; import { GLTFLoader } from './jsm/loaders/GLTFLoader.js'; import { RGBELoader } from './jsm/loaders/RGBELoader.js'; import { RoughnessMipmapper } from './jsm/utils/RoughnessMipmapper.js'; let camera, scene, renderer, stats; let pointLight, pointLight2; init(); animate(); function init() { const container = document.createElement( 'div' ); document.body.appendChild( container ); camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 1000 ); camera.position.set( 50, 50, 50 ); scene = new THREE.Scene(); //ADDING LIGHTS TO THE SCENE //Ambient Light scene.add( new THREE.AmbientLight( 0x111122 ) ); function createLight( color ) { const intensity = 1.5; const light = new THREE.PointLight( color, intensity, 20 ); light.castShadow = true; light.shadow.bias = - 0.005; // reduces self-shadowing on double-sided objects let geometry = new THREE.SphereGeometry( 0.3, 12, 6 ); let material = new THREE.MeshBasicMaterial( { color: color } ); material.color.multiplyScalar( intensity ); let sphere = new THREE.Mesh( geometry, material ); light.add( sphere ); const texture = new THREE.CanvasTexture( generateTexture() ); texture.magFilter = THREE.NearestFilter; texture.wrapT = THREE.RepeatWrapping; texture.wrapS = THREE.RepeatWrapping; texture.repeat.set( 1, 4.5 ); geometry = new THREE.SphereGeometry( 2, 32, 8 ); material = new THREE.MeshPhongMaterial( { side: THREE.DoubleSide, alphaMap: texture, alphaTest: 0.5 } ); sphere = new THREE.Mesh( geometry, material ); sphere.castShadow = true; sphere.receiveShadow = true; light.add( sphere ); // custom distance material const distanceMaterial = new THREE.MeshDistanceMaterial( { alphaMap: material.alphaMap, alphaTest: material.alphaTest } ); sphere.customDistanceMaterial = distanceMaterial; return light; } pointLight = createLight( 0x0088ff ); scene.add( pointLight ); pointLight2 = createLight( 0xff8888 ); scene.add( pointLight2 ); new RGBELoader() .setDataType( THREE.UnsignedByteType ) .setPath( 'textures/equirectangular/' ) .load( 'royal_esplanade_1k.hdr', function ( texture ) { // const envMap = pmremGenerator.fromEquirectangular( texture ).texture; // scene.background = envMap; // scene.environment = envMap; // texture.dispose(); // pmremGenerator.dispose(); // render(); // model // use of RoughnessMipmapper is optional const roughnessMipmapper = new RoughnessMipmapper( renderer ); const loader = new GLTFLoader().setPath( 'models/gltf/test/' ); loader.load( 'test.gltf', function ( gltf ) { gltf.scene.traverse( function ( child ) { if ( child.isMesh ) { // TOFIX RoughnessMipmapper seems to be broken with WebGL 2.0 roughnessMipmapper.generateMipmaps( child.material ); } } ); scene.add( gltf.scene ); // roughnessMipmapper.dispose(); render(); } ); } ); renderer = new THREE.WebGLRenderer( { antialias: true } ); renderer.shadowMap.enabled = false; renderer.shadowMap.type = THREE.VSMShadowMap; renderer.setPixelRatio( window.devicePixelRatio ); renderer.setSize( window.innerWidth, window.innerHeight ); renderer.toneMapping = THREE.ACESFilmicToneMapping; renderer.toneMappingExposure = 1; renderer.outputEncoding = THREE.sRGBEncoding; container.appendChild( renderer.domElement ); const pmremGenerator = new THREE.PMREMGenerator( renderer ); pmremGenerator.compileEquirectangularShader(); const controls = new OrbitControls( camera, renderer.domElement ); controls.addEventListener( 'change', render ); // use if there is no animation loop controls.minDistance = 2; controls.maxDistance = 10; controls.target.set( 0, 0, - 0.2 ); controls.update(); window.addEventListener( 'resize', onWindowResize ); } function generateTexture() { const canvas = document.createElement( 'canvas' ); canvas.width = 2; canvas.height = 2; const context = canvas.getContext( '2d' ); context.fillStyle = 'white'; context.fillRect( 0, 1, 2, 1 ); return canvas; } function onWindowResize() { camera.aspect = window.innerWidth / window.innerHeight; camera.updateProjectionMatrix(); renderer.setSize( window.innerWidth, window.innerHeight ); render(); } function animate() { requestAnimationFrame( animate ); render(); } function render() { let time = performance.now() * 0.001; pointLight.position.x = Math.sin( time * 0.6 ) * 9; pointLight.position.y = Math.sin( time * 0.7 ) * 9 + 6; pointLight.position.z = Math.sin( time * 0.8 ) * 9; pointLight.rotation.x = time; pointLight.rotation.z = time; time += 10000; pointLight2.position.x = Math.sin( time * 0.6 ) * 9; pointLight2.position.y = Math.sin( time * 0.7 ) * 9 + 6; pointLight2.position.z = Math.sin( time * 0.8 ) * 9; pointLight2.rotation.x = time; pointLight2.rotation.z = time; renderer.render( scene, camera ); } </script> </body> </html>
three.js test 1.0
Day 2
The Spare Room v.62 poster version
Day 1
The Spare Room v.59