Skip to content

Commit

Permalink
chore(sample): update samples
Browse files Browse the repository at this point in the history
  • Loading branch information
lslzl3000 committed Jul 10, 2024
1 parent 588721f commit d70743b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 24 deletions.
2 changes: 1 addition & 1 deletion samples/lights/PointLightsScript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class PointLightsScript extends ComponentBase {
poi.b = Math.random() + 0.1;
poi.intensity = 0.6 * Math.random() + 0.3;
poi.range = 10 * Math.random() + 20;
poi.castShadow = true;
poi.castShadow = false;
poi.radius = 0.01;
poi.at = 8;

Expand Down
5 changes: 1 addition & 4 deletions samples/lights/Sample_PointLight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ export class Sample_PointLight {
view.scene = this.scene;
view.camera = mainCamera;

Engine3D.startRenderViews([view]);

let postProcessing = this.scene.addComponent(PostProcessingComponent);
postProcessing.addPost(FXAAPost);
Engine3D.startRenderView(view);

GUIUtil.renderDebug();
}
Expand Down
5 changes: 3 additions & 2 deletions samples/physics/Sample_EatTheBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class Sample_EatTheBox {
//set shadow
Engine3D.setting.shadow.updateFrameRate = 1;
Engine3D.setting.shadow.shadowSize = 2048;
Engine3D.setting.shadow.shadowBound = 64;
Engine3D.setting.shadow.shadowBound = 100;
Engine3D.setting.shadow.shadowBias = 0.01;
//get original ammo world for processing more custom function
this.ammoWorld = Physics.world;

Expand All @@ -44,7 +45,7 @@ class Sample_EatTheBox {
//add DirectLight
let lightObj = new Object3D();
let light = lightObj.addComponent(DirectLight);
light.intensity = 50;
light.intensity = 8;
light.castShadow = true;
lightObj.rotationX = 60;
lightObj.rotationY = 80;
Expand Down
5 changes: 3 additions & 2 deletions samples/physics/Sample_ShootTheBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ class Sample_ShootTheBox {
//set shadow
Engine3D.setting.shadow.updateFrameRate = 1;
Engine3D.setting.shadow.shadowSize = 2048;
Engine3D.setting.shadow.shadowBound = 64;
Engine3D.setting.shadow.shadowBound = 50;
Engine3D.setting.shadow.shadowBias = 0.005;

//add mouse event listener
Engine3D.inputSystem.addEventListener(PointerEvent3D.POINTER_DOWN, this.MouseDown, this);
Expand All @@ -42,7 +43,7 @@ class Sample_ShootTheBox {
//add DirectLight
let lightObj = new Object3D();
let light = lightObj.addComponent(DirectLight);
light.intensity = 50;
light.intensity = 8;
light.castShadow = true;
lightObj.rotationX = 60;
lightObj.rotationY = 140;
Expand Down
17 changes: 2 additions & 15 deletions samples/post/Sample_GodRay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export class Sample_GodRay {

async run() {
Engine3D.setting.shadow.shadowSize = 2048
Engine3D.setting.shadow.shadowBound = 500;
Engine3D.setting.shadow.shadowBias = 0.05;
Engine3D.setting.shadow.shadowBound = 400;
Engine3D.setting.shadow.shadowBias = 0.1;
Engine3D.setting.render.debug = true;

await Engine3D.init({ renderLoop: () => { this.loop() } });
Expand Down Expand Up @@ -58,19 +58,6 @@ export class Sample_GodRay {
}

async initScene() {
{
this.lightObj = new Object3D();
this.lightObj.rotationX = 15;
this.lightObj.rotationY = 110;
this.lightObj.rotationZ = 0;
let lc = this.lightObj.addComponent(DirectLight);
lc.lightColor = KelvinUtil.color_temperature_to_rgb(5355);
lc.castShadow = true;
lc.intensity = 5;
this.scene.addChild(this.lightObj);
GUIUtil.renderDirLight(lc, false);
}

{
let mat = new LitMaterial();
mat.roughness = 0.5;
Expand Down

0 comments on commit d70743b

Please sign in to comment.