-
-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: autodetect sRGB compression * feat: remove inline sRGB decode * chore: remove roughness mipmapper * feat: added constant SRGB8 * feat: WebGLCubeUVMaps: Add support for render targets * chore: Remove RGBFormat (#159) * change: Remove RGBFormat See: mrdoob/three.js#23223 See: mrdoob/three.js#23228 * change: Remove .format from Material See: mrdoob/three.js#23219 It will be replaced with .alphaWrite later See: mrdoob/three.js#23166 * test: remove use of RGBFormat from a test case * feat: add LDrawUtils * chore: make ConvexGeometry points optional * chore: remove RGBIntegerFormat * feat: Box3 now supports computing minimal bounds for setFromObject * feat(Material): Add a new property .alphaWrite (#161) Since it's undocumented I could not fill the doc comment properly,,, See: mrdoob/three.js#23166 * chore: remove UnsignedShort565Type * chore: remove RoomEnvironment from OTHER_FILES * chore: remove LDrawLoader from OTHER_FILES * chore: fix linting * chore: fix linting Co-authored-by: 0b5vr <[email protected]>
- Loading branch information
1 parent
7a91e7f
commit 76d373f
Showing
19 changed files
with
285 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { BufferGeometry, Vector3 } from '../../../src/Three'; | ||
|
||
export class ConvexGeometry extends BufferGeometry { | ||
constructor(points: Vector3[]); | ||
constructor(points?: Vector3[]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { Group, Object3D } from '../../../src/Three'; | ||
|
||
export namespace LDrawUtils { | ||
function mergeObject(object: Object3D): Group; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
import { CompressedPixelFormat, TextureEncoding } from '../../constants'; | ||
|
||
export class WebGLUtils { | ||
constructor(gl: WebGLRenderingContext | WebGL2RenderingContext, extensions: any, capabilities: any); | ||
|
||
convert(p: any): void; | ||
convert(p: CompressedPixelFormat, encoding?: TextureEncoding | null): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import * as THREE from 'three'; | ||
|
||
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls'; | ||
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader'; | ||
import { RGBELoader } from 'three/examples/jsm/loaders/RGBELoader'; | ||
|
||
let camera: THREE.PerspectiveCamera; | ||
let scene: THREE.Scene; | ||
let renderer: THREE.WebGLRenderer; | ||
|
||
init(); | ||
render(); | ||
|
||
function init() { | ||
const container = document.createElement('div'); | ||
document.body.appendChild(container); | ||
|
||
camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.25, 20); | ||
camera.position.set(-1.8, 0.6, 2.7); | ||
|
||
scene = new THREE.Scene(); | ||
|
||
new RGBELoader().setPath('textures/equirectangular/').load('royal_esplanade_1k.hdr', texture => { | ||
texture.mapping = THREE.EquirectangularReflectionMapping; | ||
|
||
scene.background = texture; | ||
scene.environment = texture; | ||
|
||
render(); | ||
|
||
// model | ||
|
||
const loader = new GLTFLoader().setPath('models/gltf/DamagedHelmet/glTF/'); | ||
loader.load('DamagedHelmet.gltf', gltf => { | ||
scene.add(gltf.scene); | ||
|
||
render(); | ||
}); | ||
}); | ||
|
||
renderer = new THREE.WebGLRenderer({ antialias: true }); | ||
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 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 onWindowResize() { | ||
camera.aspect = window.innerWidth / window.innerHeight; | ||
camera.updateProjectionMatrix(); | ||
|
||
renderer.setSize(window.innerWidth, window.innerHeight); | ||
|
||
render(); | ||
} | ||
|
||
// | ||
|
||
function render() { | ||
renderer.render(scene, camera); | ||
} |
Oops, something went wrong.