alpha
Login
or
Join now
flo-bit.dev
/
flo-bit.github.io
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
[READ-ONLY] Mirror of https://github.com/flo-bit/flo-bit.github.io. my personal website, w/ astro, svelte, tailwind, typescript, threlte
flo-bit.dev/
portfolio
portfolio-website
svelte
sveltekit
tailwind
threejs
threlte
typescript
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
vision pro: env fix
author
Florian
date
2 years ago
(Jul 4, 2024, 12:25 AM +0200)
commit
53acb3c1
53acb3c1069eb3a8613b52fdb7ef994f258d9853
parent
5bd98e04
5bd98e04e43227a85d96e94c22e95db7cfa9102c
+16
-2
1 changed file
Expand all
Collapse all
Unified
Split
src
lib
vr
Scene.svelte
+16
-2
src/lib/vr/Scene.svelte
View file
Reviewed
···
1
1
<script lang="ts">
2
2
-
import { T } from '@threlte/core';
2
2
+
import { T, useThrelte } from '@threlte/core';
3
3
import { Environment, interactivity } from '@threlte/extras';
4
4
5
5
import Stars from './components/Stars.svelte';
···
14
14
import Controls from './components/Controls.svelte';
15
15
import Pong from './sections/Pong.svelte';
16
16
17
17
+
import { HalfFloatType, EquirectangularReflectionMapping, SRGBColorSpace } from 'three';
18
18
+
19
19
+
import { RGBELoader } from 'three/examples/jsm/loaders/RGBELoader.js';
20
20
+
17
21
interactivity();
18
22
pointerControls('left');
19
23
pointerControls('right');
24
24
+
25
25
+
const { scene } = useThrelte();
26
26
+
27
27
+
const loader = new RGBELoader();
28
28
+
loader.setDataType(HalfFloatType);
29
29
+
30
30
+
loader.load('/shanghai_riverside_1k.hdr', (texture) => {
31
31
+
texture.mapping = EquirectangularReflectionMapping;
32
32
+
texture.colorSpace = SRGBColorSpace;
33
33
+
scene.environment = texture;
34
34
+
});
20
35
</script>
21
36
22
37
<Controller right />
···
30
45
</T.PerspectiveCamera>
31
46
32
47
<Stars />
33
33
-
<Environment files="/shanghai_riverside_1k.hdr" />
34
48
35
49
<T.DirectionalLight position={[0, 1, 0]} intensity={0.5} />
36
50