Skip to content

Commit

Permalink
example updates
Browse files Browse the repository at this point in the history
  • Loading branch information
gkjohnson committed Jul 4, 2022
1 parent 00bae3c commit 9cead4f
Show file tree
Hide file tree
Showing 8 changed files with 17,074 additions and 70 deletions.
4 changes: 2 additions & 2 deletions example/customMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
Sphere,
} from 'three';
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';
import * as dat from 'three/examples/jsm/libs/dat.gui.module.js';
import { GUI } from 'three/examples/jsm/libs/lil-gui.module.min.js';
import Stats from 'three/examples/jsm/libs/stats.module.js';

let camera, controls, scene, renderer, tiles, orthoCamera;
Expand Down Expand Up @@ -270,7 +270,7 @@ function init() {
window.addEventListener( 'resize', onWindowResize, false );

// GUI
const gui = new dat.GUI();
const gui = new GUI();
gui.width = 300;
gui.add( params, 'orthographic' );
gui.add( params, 'material', { DEFAULT, GRADIENT, TOPOGRAPHIC_LINES, LIGHTING } )
Expand Down
4 changes: 2 additions & 2 deletions example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { FlyOrbitControls } from './FlyOrbitControls.js';
import { BufferGeometryUtils } from 'three/examples/jsm/utils/BufferGeometryUtils.js';
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
import { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader.js';
import * as dat from 'three/examples/jsm/libs/dat.gui.module.js';
import { GUI } from 'three/examples/jsm/libs/lil-gui.module.min.js';
import Stats from 'three/examples/jsm/libs/stats.module.js';

const ALL_HITS = 1;
Expand Down Expand Up @@ -247,7 +247,7 @@ function init() {


// GUI
const gui = new dat.GUI();
const gui = new GUI();
gui.width = 300;

const tileOptions = gui.addFolder( 'Tiles Options' );
Expand Down
4 changes: 2 additions & 2 deletions example/ionExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { FlyOrbitControls } from './FlyOrbitControls.js';
import { BufferGeometryUtils } from 'three/examples/jsm/utils/BufferGeometryUtils.js';
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
import { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader.js';
import * as dat from 'three/examples/jsm/libs/dat.gui.module.js';
import { GUI } from 'three/examples/jsm/libs/lil-gui.module.min.js';
import Stats from 'three/examples/jsm/libs/stats.module.js';

const ALL_HITS = 1;
Expand Down Expand Up @@ -348,7 +348,7 @@ function init() {


// GUI
const gui = new dat.GUI();
const gui = new GUI();
gui.width = 300;

const ionOptions = gui.addFolder( 'Ion' );
Expand Down
4 changes: 2 additions & 2 deletions example/mars.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
FogExp2,
} from 'three';
import { FlyOrbitControls } from './FlyOrbitControls.js';
import * as dat from 'three/examples/jsm/libs/dat.gui.module.js';
import { GUI } from 'three/examples/jsm/libs/lil-gui.module.min.js';

let camera, controls, scene, renderer;
let groundTiles, skyTiles;
Expand Down Expand Up @@ -82,7 +82,7 @@ function init() {
onWindowResize();
window.addEventListener( 'resize', onWindowResize, false );

const gui = new dat.GUI();
const gui = new GUI();
gui.add( params, 'fog' ).onChange( v => {

scene.fog = v ? fog : null;
Expand Down
17 changes: 9 additions & 8 deletions example/offscreenShadows.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
Sphere,
} from 'three';
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';
import * as dat from 'three/examples/jsm/libs/dat.gui.module.js';
import { GUI } from 'three/examples/jsm/libs/lil-gui.module.min.js';
import Stats from 'three/examples/jsm/libs/stats.module.js';

let camera, controls, scene, renderer, tiles, orthoCamera;
Expand Down Expand Up @@ -81,7 +81,7 @@ function init() {
document.body.appendChild( renderer.domElement );

camera = new PerspectiveCamera( 60, window.innerWidth / window.innerHeight, 1, 4000 );
camera.position.set( - 21, 13, 25 );
camera.position.set( - 56, 232, 260 );

orthoCamera = new OrthographicCamera();

Expand All @@ -95,14 +95,15 @@ function init() {
dirLight = new DirectionalLight( 0xffffff, 1.25 );
dirLight.position.set( - 100, 40, 10 );
dirLight.castShadow = true;
dirLight.shadow.bias = - 0.00001;
dirLight.shadow.bias = - 1e-4;
dirLight.shadow.normalBias = 0.2;
dirLight.shadow.mapSize.setScalar( 2048 );

const shadowCam = dirLight.shadow.camera;
shadowCam.left = - 100;
shadowCam.bottom = - 100;
shadowCam.right = 100;
shadowCam.top = 100;
shadowCam.left = - 120;
shadowCam.bottom = - 120;
shadowCam.right = 120;
shadowCam.top = 120;
shadowCam.updateProjectionMatrix();

scene.add( dirLight );
Expand All @@ -128,7 +129,7 @@ function init() {
window.addEventListener( 'resize', onWindowResize, false );

// GUI
const gui = new dat.GUI();
const gui = new GUI();
gui.width = 300;
gui.add( params, 'orthographic' );
gui.add( params, 'errorTarget' ).min( 0 ).max( 25 ).step( 1 );
Expand Down
4 changes: 2 additions & 2 deletions example/vr.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
RingBufferGeometry,
Sphere,
} from 'three';
import * as dat from 'three/examples/jsm/libs/dat.gui.module.js';
import { GUI } from 'three/examples/jsm/libs/lil-gui.module.min.js';
import { VRButton } from 'three/examples/jsm/webxr/VRButton.js';
import { XRControllerModelFactory } from 'three/examples/jsm/webxr/XRControllerModelFactory.js';

Expand Down Expand Up @@ -173,7 +173,7 @@ function init() {
window.addEventListener( 'resize', onWindowResize, false );

// GUI
const gui = new dat.GUI();
const gui = new GUI();
gui.width = 300;
gui.add( params, 'displayGrid' );
gui.add( params, 'displayBoxBounds' );
Expand Down
Loading

0 comments on commit 9cead4f

Please sign in to comment.