Skip to content

Commit

Permalink
Update to vite 3.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
mayacoda committed Jul 28, 2022
1 parent 75ca64a commit c0ab23f
Show file tree
Hide file tree
Showing 6 changed files with 121 additions and 103 deletions.
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ public
.husky
package-lock.json
.yarnrc.yml

*.glsl
*.vert
*.frag
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"prettier": "2.7.1",
"sass": "^1.52.3",
"typescript": "^4.7.4",
"vite": "^2.9.12",
"vite": "^3.0.3",
"vite-plugin-glsl": "^0.1.5"
},
"packageManager": "[email protected]",
Expand Down
7 changes: 6 additions & 1 deletion src/demo/Box.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import * as THREE from 'three'
import vertexShader from './shader.vert'
import fragmentShader from './shader.frag'

export class Box extends THREE.Mesh {
constructor() {
const geometry = new THREE.BoxBufferGeometry(1, 1, 1)
const material = new THREE.MeshStandardMaterial({ color: 0xff00ff })
const material = new THREE.ShaderMaterial({
vertexShader,
fragmentShader,
})

super(geometry, material)
}
Expand Down
3 changes: 3 additions & 0 deletions src/demo/shader.frag
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
void main() {
gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
}
3 changes: 3 additions & 0 deletions src/demo/shader.vert
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
void main() {
gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(position, 1.0);
}
Loading

0 comments on commit c0ab23f

Please sign in to comment.