Skip to content

Commit

Permalink
chore: update ssr sample
Browse files Browse the repository at this point in the history
  • Loading branch information
lslzl3000 committed Jul 23, 2024
1 parent 2a446a2 commit fbc00a6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@orillusion/core",
"version": "0.8.2",
"version": "0.8.3-dev.1",
"author": "Orillusion",
"description": "Orillusion WebGPU Engine",
"type": "module",
Expand Down
23 changes: 15 additions & 8 deletions samples/post/Sample_SSR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ export class Sample_SSR {
if (mr && mr.material) {
if (mr.material.name == 'ToyCar') {
let mat = mr.material as LitMaterial;
mat.metallic = 0.5;
mat.clearcoatFactor = 0.25;
mat.metallic = 0.9;
mat.roughness = 0.1;
mat.clearcoatFactor = 0.5;
}
}
}
Expand All @@ -77,14 +78,10 @@ export class Sample_SSR {
private sphere: Object3D

private async createPlane(scene: Scene3D) {
let mat = new LitMaterial()
mat.roughness = 0.2
mat.metallic = 0.5

{
let floorMaterial = new LitMaterial()
floorMaterial.roughness = 0.12
floorMaterial.metallic = 0.5
floorMaterial.roughness = 0.1
floorMaterial.metallic = 1.0

let planeGeometry = new PlaneGeometry(200, 200)
let floor: Object3D = new Object3D()
Expand All @@ -93,11 +90,16 @@ export class Sample_SSR {
mr.geometry = planeGeometry
scene.addChild(floor)

GUIHelp.addFolder('floor')
GUIHelp.add(floorMaterial, 'roughness', 0.01, 1, 0.01)
GUIHelp.add(floorMaterial, 'metallic', 0, 1, 0.01)
GUIHelp.endFolder()
}

{
let mat = new LitMaterial()
mat.roughness = 0.1
mat.metallic = 0.9
let sphereGeometry = new SphereGeometry(10, 50, 50)
let obj: Object3D = new Object3D()
let mr = obj.addComponent(MeshRenderer)
Expand All @@ -107,6 +109,11 @@ export class Sample_SSR {
obj.y = 10
scene.addChild(obj)
this.sphere = obj

GUIHelp.addFolder('sphere')
GUIHelp.add(mat, 'roughness', 0.01, 1, 0.01)
GUIHelp.add(mat, 'metallic', 0, 1, 0.01)
GUIHelp.endFolder()
}

{
Expand Down

0 comments on commit fbc00a6

Please sign in to comment.