Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lock threejs version to keep in sync with example-project #79

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions example-project/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "renin-example-project",
"version": "2.1.0",
"version": "2.2.0",
"type": "module",
"private": true,
"scripts": {
Expand All @@ -9,14 +9,14 @@
"serve": "vite preview"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "*",
"typescript": "*",
"vite": "*",
"vite-plugin-string": "*"
"@rollup/plugin-node-resolve": "^15.0.1",
"typescript": "^4.9.5",
"vite": "^4.1.1",
"vite-plugin-string": "^1.2.1"
},
"dependencies": {
"@types/three": "*",
"renin": "*",
"three": "*"
"@types/three": "~0.149.0",
"renin": "^2.2.1",
"three": "~0.149.0"
}
}
4 changes: 2 additions & 2 deletions example-project/src/SpinningDonut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
Scene,
sRGBEncoding,
TextureLoader,
TorusBufferGeometry,
TorusGeometry,
WebGLRenderer,
WebGLRenderTarget,
} from 'three';
Expand Down Expand Up @@ -46,7 +46,7 @@ export class SpinningDonut extends ReninNode {
envMapTexture.encoding = sRGBEncoding;

this.cube = new Mesh(
new TorusBufferGeometry(2, 1, 64, 64),
new TorusGeometry(2, 1, 64, 64),
new MeshPhysicalMaterial({
clearcoat: 1,
envMap: envMapTexture,
Expand Down
3 changes: 3 additions & 0 deletions example-project/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ export const renin = new Renin({
bpm: 114,
subdivision: 12,
beatOffset: 4,
beatsPerBar: 4,
},
root: PostFx,
productionMode: import.meta.env.PROD,
rendererOptions: {
powerPreference: 'high-performance',
},
toneMapping: ACESFilmicToneMapping,
maxWidth: 1920,
maxHeight: 1080,
});

renin.loop();
2 changes: 1 addition & 1 deletion example-project/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default defineConfig({
plugins: [
reninPlugin(),
nodeResolve(),
vitePluginString.default({
vitePluginString({
include: ['**/*.vs', '**/*.fs', '**/*.vert', '**/*.frag', '**/*.glsl'],
compress: false,
}),
Expand Down
4 changes: 2 additions & 2 deletions renin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "renin",
"version": "2.2.0",
"version": "2.2.1",
"bin": "cli",
"module": "lib/renin.js",
"files": [
Expand All @@ -13,7 +13,7 @@
"@betit/rollup-plugin-rename-extensions": "^0.1.0",
"@rollup/plugin-typescript": "^9.0.1",
"@types/node": "^18.11.0",
"@types/three": "^0.144.0",
"@types/three": "~0.149.0",
"prettier": "^2.7.1",
"rollup": "^2.70.2",
"rollup-plugin-import-css": "^3.0.3",
Expand Down
11 changes: 5 additions & 6 deletions renin/src/ui/AudioBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
RepeatWrapping,
Texture,
ShaderMaterial,
BoxBufferGeometry,
sRGBEncoding,
} from 'three';
import { colors } from './colors';
Expand All @@ -25,7 +24,7 @@ const boxHeight = 40;
const boxPadding = 8;
const glowSize = 12;

const boxBufferGeometry = new BoxBufferGeometry();
const boxGeometry = new BoxGeometry();

const uiboxStore: { [key: string]: UIBox } = {};
const getUIBox = (name: string) => {
Expand Down Expand Up @@ -299,7 +298,7 @@ export class AudioBar {
this.audioBar.setSize(1, barHeight);
this.obj.add(this.audioBar.object3d);
this.audioTrack = new Mesh(
boxBufferGeometry,
boxGeometry,
new MeshBasicMaterial({
map: new CanvasTexture(gradientCanvas),
color: colors.green._500,
Expand All @@ -314,19 +313,19 @@ export class AudioBar {
this.audioTrack.material.map.wrapS = RepeatWrapping;
this.audioTrack.material.map.wrapT = RepeatWrapping;
}
const line = new Mesh(boxBufferGeometry, new MeshBasicMaterial({ color: colors.green._500 }));
const line = new Mesh(boxGeometry, new MeshBasicMaterial({ color: colors.green._500 }));
line.position.x = 0.5;
line.scale.x = 2 / glowSize;
this.audioTrack.add(line);
this.cuePoints = [
new Mesh(
boxBufferGeometry,
boxGeometry,
new MeshBasicMaterial({
color: colors.orange._500,
})
),
new Mesh(
boxBufferGeometry,
boxGeometry,
new MeshBasicMaterial({
color: colors.orange._300,
})
Expand Down
6 changes: 3 additions & 3 deletions renin/src/ui/UIBox.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
BoxBufferGeometry,
BoxGeometry,
BufferAttribute,
BufferGeometry,
Material,
Expand Down Expand Up @@ -119,12 +119,12 @@ export function makeRoundedRectangleBufferGeometry(
return geometry;
}

const geometry = new BoxBufferGeometry();
const geometry = new BoxGeometry();

export class UIBox<MaterialType extends Material = MeshBasicMaterial> {
object3d = new Object3D();
private mesh: Mesh<BufferGeometry, MaterialType>;
private shadow: Mesh<BoxBufferGeometry, RawShaderMaterial>;
private shadow: Mesh<BoxGeometry, RawShaderMaterial>;
options: UIBoxOptions<MaterialType>;

constructor(options: Partial<UIBoxOptions<MaterialType>>) {
Expand Down
Loading