10000 use sculpture-park-core + works with js type · shader-park/shader-park-renderer@039e03b · GitHub
[go: up one dir, main page]

Skip to content

Commit 039e03b

Browse files
committed
use sculpture-park-core + works with js type
1 parent 2e8e130 commit 039e03b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/Sculpture.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as THREE from 'three';
2-
import { defaultVertexSource, sculptureStarterCode, fragFooter} from './core-glsl.js'
2+
import { defaultVertexSource, sculptureStarterCode, fragFooter } from 'sculpture-park-core'
33
import { sketch } from './sketch.js'
44

55
export class Sculpture {

src/there-scene.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as THREE from 'three';
22
// import * as OrbitControls from './OrbitControls.js'
33
import { Sculpture } from './Sculpture.js'
4+
import { sourceGenerator } from 'sculpture-park-core'
45

56
export const renderScene = (container, sculptureData) => {
67
// const container = document.querySelector('.container');
@@ -30,6 +31,11 @@ export const renderScene = (container, sculptureData) => {
3031
// container.addEventListener('mouseup', this.onMouseUp, false);
3132
document.addEventListener('mousemove', onDocumentMouseMove, false);
3233

34+
if (sculptureData.type === "js") {
35+
let source = sourceGenerator(sculptureData.shaderSource);
36+
sculptureData.shaderSource = source.geoGLSL + source.colorGLSL;
37+
}
38+
3339
let objectsToRaycast = [];
3440
let sculpture = new Sculpture(1, texture, sculptureData);
3541
scene.add(sculpture.mesh);

0 commit comments

Comments
 (0)
0