diff --git a/scripts/app.js b/scripts/app.js index 5375323..870d6bd 100644 --- a/scripts/app.js +++ b/scripts/app.js @@ -23,11 +23,12 @@ class App { initScene = () => { this.scene = new THREE.Scene(); + // this.scene.backgroundColor = new THREE.Color(0xff0000); }; initRenderer = () => { this.renderer = new THREE.WebGLRenderer({ alpha: true }); - this.renderer.setClearColor(0x141416, 1.0); + this.renderer.setClearColor(0x000000, 0); this.renderer.setSize(window.innerWidth, window.innerHeight); this.renderer.setPixelRatio(window.devicePixelRatio * 1.5); this.renderer.shadowMap.enabled = true; diff --git a/scripts/shaders.js b/scripts/shaders.js index 533226f..045f0d2 100644 --- a/scripts/shaders.js +++ b/scripts/shaders.js @@ -1,8 +1,8 @@ const shaders = { - atmosphere: {}, - globe: {}, - dot: {} -} + atmosphere: {}, + globe: {}, + dot: {}, +}; shaders.globe.vertexShader = ` varying vec3 vNormal; @@ -12,7 +12,7 @@ shaders.globe.vertexShader = ` vNormal = normalize( normalMatrix * normal ); vUv = uv; } -` +`; shaders.globe.fragmentShader = ` uniform sampler2D texture; @@ -24,7 +24,7 @@ shaders.globe.fragmentShader = ` vec3 atmosphere = vec3( 1.0, 1.0, 1.0 ) * pow( intensity, 3.0 ); gl_FragColor = vec4( diffuse + atmosphere, 1.0 ); } -` +`; shaders.atmosphere.vertexShader = ` varying vec3 vNormal; @@ -32,7 +32,7 @@ shaders.atmosphere.vertexShader = ` vNormal = normalize( normalMatrix * normal ); gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); } -` +`; shaders.atmosphere.fragmentShader = ` varying vec3 vNormal; @@ -41,8 +41,7 @@ shaders.atmosphere.fragmentShader = ` float intensity = pow( 0.7 - dot( vNormal, vec3( 0.0, 0.0, 1.0 ) ), 4.0 ); gl_FragColor = vec4( 1.0, 1.0, 1.0, 1.0 ) * intensity; } -` - +`; shaders.dot.vertexShader = ` attribute float size; @@ -54,8 +53,7 @@ shaders.dot.vertexShader = ` gl_PointSize = size * ( 300.0 / -mvPosition.z ); gl_Position = projectionMatrix * mvPosition; } -` - +`; shaders.dot.fragmentShader = ` uniform vec3 color; @@ -66,4 +64,4 @@ shaders.dot.fragmentShader = ` gl_FragColor = gl_FragColor * texture2D( pointTexture, gl_PointCoord ); if ( gl_FragColor.a < ALPHATEST ) discard; } -` \ No newline at end of file +`;