@@ -17,6 +17,14 @@ import { NgtsOrbitControls } from 'angular-three-soba/controls';
1717import { injectGLTF } from 'angular-three-soba/loaders' ;
1818import { NgtsAnimation , injectAnimations } from 'angular-three-soba/misc' ;
1919import { injectMatcapTexture } from 'angular-three-soba/staging' ;
20+ import {
21+ NgtTweakCheckbox ,
22+ NgtTweakColor ,
23+ NgtTweakFolder ,
24+ NgtTweakList ,
25+ NgtTweakNumber ,
26+ NgtTweakPane ,
27+ } from 'angular-three-tweakpane' ;
2028import { Bone , Group , MeshStandardMaterial , Object3D , SRGBColorSpace , SkinnedMesh } from 'three' ;
2129import { GLTF } from 'three-stdlib' ;
2230
@@ -105,7 +113,7 @@ export class Bot {
105113@Component ( {
106114 selector : 'app-basic-scene-graph' ,
107115 template : `
108- <ngt-color *args="['#303030' ]" attach="background" />
116+ <ngt-color *args="[backgroundColor() ]" attach="background" />
109117 <ngt-ambient-light [intensity]="0.8" />
110118 <ngt-point-light [intensity]="Math.PI" [decay]="0" [position]="[0, 6, 0]" />
111119
@@ -115,7 +123,12 @@ export class Bot {
115123 <ngtp-effect-composer>
116124 @if (bloom()) {
117125 <ngtp-bloom
118- [options]="{ kernelSize: 3, luminanceThreshold: 0, luminanceSmoothing: 0.4, intensity: 1.5 }"
126+ [options]="{
127+ kernelSize: 3,
128+ luminanceThreshold: luminanceThreshold(),
129+ luminanceSmoothing: luminanceSmoothing(),
130+ intensity: intensity(),
131+ }"
119132 />
120133 }
121134
@@ -126,8 +139,48 @@ export class Bot {
126139
127140 <ngts-orbit-controls [options]="{ makeDefault: true, autoRotate: true }" />
128141 }
142+
143+ <ngt-tweak-pane title="Soba Basic">
144+ <ngt-tweak-folder title="Bloom">
145+ <ngt-tweak-checkbox [(value)]="bloom" label="Enabled" />
146+ <ngt-tweak-number
147+ [(value)]="luminanceThreshold"
148+ label="luminanceThreshold"
149+ [params]="{ min: 0, max: 1, step: 0.01 }"
150+ />
151+ <ngt-tweak-number
152+ [(value)]="luminanceSmoothing"
153+ label="luminanceSmoothing"
154+ [params]="{ min: 0, max: 1, step: 0.01 }"
155+ />
156+ <ngt-tweak-number
157+ [(value)]="intensity"
158+ label="bloomIntensity"
159+ [params]="{ min: 0, max: 10, step: 0.5 }"
160+ />
161+ </ngt-tweak-folder>
162+ <ngt-tweak-folder title="Glitch">
163+ <ngt-tweak-checkbox [(value)]="glitch" label="Enabled" />
164+ </ngt-tweak-folder>
165+
166+ <ngt-tweak-list [(value)]="selectedAction" [options]="['Strut', 'Dance', 'Idle']" label="Animation" />
167+ <ngt-tweak-color [(value)]="backgroundColor" label="Background" />
168+ </ngt-tweak-pane>
129169 ` ,
130- imports : [ NgtsOrbitControls , NgtArgs , Bot , NgtpEffectComposer , NgtpBloom , NgtpGlitch ] ,
170+ imports : [
171+ NgtsOrbitControls ,
172+ NgtArgs ,
173+ Bot ,
174+ NgtpEffectComposer ,
175+ NgtpBloom ,
176+ NgtpGlitch ,
177+ NgtTweakPane ,
178+ NgtTweakFolder ,
179+ NgtTweakCheckbox ,
180+ NgtTweakList ,
181+ NgtTweakColor ,
182+ NgtTweakNumber ,
183+ ] ,
131184 changeDetection : ChangeDetectionStrategy . OnPush ,
132185 schemas : [ CUSTOM_ELEMENTS_SCHEMA ] ,
133186 host : { class : 'soba-experience' } ,
@@ -136,6 +189,13 @@ export class SceneGraph {
136189 protected Math = Math ;
137190 protected bloom = bloom ;
138191 protected glitch = glitch ;
192+ protected selectedAction = selectedAction ;
193+
194+ protected backgroundColor = signal ( '#303030' ) ;
195+
196+ protected luminanceThreshold = signal ( 0 ) ;
197+ protected luminanceSmoothing = signal ( 0.4 ) ;
198+ protected intensity = signal ( 1.5 ) ;
139199
140200 asRenderTexture = input ( false ) ;
141201}
0 commit comments