Skip to content

Commit

Permalink
Fix threejs portal demo (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
rndexe authored Aug 15, 2024
1 parent f85a989 commit df712af
Show file tree
Hide file tree
Showing 4 changed files with 435 additions and 60 deletions.
5 changes: 2 additions & 3 deletions demos/threejs-journey-portal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
"dependencies": {
"@react-three/drei": "^9.109.5",
"@react-three/fiber": "^8.17.5",
"babel-plugin-glsl": "^1.0.0",
"babel-plugin-macros": "^3.1.0",
"glsl-noise": "^0.0.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"vite-plugin-glslify": "^2.1.0",
"three": "^0.165.0"
},
"devDependencies": {
Expand All @@ -30,7 +29,7 @@
"dev": "vite --host",
"dev3": "e2e-dev $npm_package_name",
"build": "tsc && vite build",
"bbuild2": "tsc && e2e-build $npm_package_name",
"build2": "tsc && e2e-build $npm_package_name",
"preview": "vite preview"
},
"browserslist": [
Expand Down
4 changes: 2 additions & 2 deletions demos/threejs-journey-portal/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useRef } from 'react'
import { Color, AdditiveBlending } from 'three'
import { Canvas, extend, useFrame } from '@react-three/fiber'
import { OrbitControls, Sparkles, shaderMaterial, useGLTF, useTexture } from '@react-three/drei'
import glsl from 'babel-plugin-glsl/macro'
import glsl from 'glslify'

import portalModel from './portal-2.glb?url'
import backedImg from './baked-02.jpeg'
Expand Down Expand Up @@ -61,7 +61,7 @@ const PortalMaterial = shaderMaterial(
vec3 color = mix(uColorStart, uColorEnd, strength);
gl_FragColor = vec4(color, 1.0);
#include <tonemapping_fragment>
#include <encodings_fragment>
#include <colorspace_fragment>
}`,
)

Expand Down
3 changes: 2 additions & 1 deletion demos/threejs-journey-portal/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import glslify from 'vite-plugin-glslify/dist/index.mjs'

export default defineConfig({
plugins: [react()],
plugins: [react(), glslify({ include: [/\.jsx$/] })],
})
Loading

0 comments on commit df712af

Please sign in to comment.