@@ -17,6 +17,14 @@ import { NgtsOrbitControls } from 'angular-three-soba/controls';
17
17
import { injectGLTF } from 'angular-three-soba/loaders' ;
18
18
import { NgtsAnimation , injectAnimations } from 'angular-three-soba/misc' ;
19
19
import { 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' ;
20
28
import { Bone , Group , MeshStandardMaterial , Object3D , SRGBColorSpace , SkinnedMesh } from 'three' ;
21
29
import { GLTF } from 'three-stdlib' ;
22
30
@@ -105,7 +113,7 @@ export class Bot {
105
113
@Component ( {
106
114
selector : 'app-basic-scene-graph' ,
107
115
template : `
108
- <ngt-color *args="['#303030' ]" attach="background" />
116
+ <ngt-color *args="[backgroundColor() ]" attach="background" />
109
117
<ngt-ambient-light [intensity]="0.8" />
110
118
<ngt-point-light [intensity]="Math.PI" [decay]="0" [position]="[0, 6, 0]" />
111
119
@@ -115,7 +123,12 @@ export class Bot {
115
123
<ngtp-effect-composer>
116
124
@if (bloom()) {
117
125
<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
+ }"
119
132
/>
120
133
}
121
134
@@ -126,8 +139,48 @@ export class Bot {
126
139
127
140
<ngts-orbit-controls [options]="{ makeDefault: true, autoRotate: true }" />
128
141
}
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>
129
169
` ,
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
+ ] ,
131
184
changeDetection : ChangeDetectionStrategy . OnPush ,
132
185
schemas : [ CUSTOM_ELEMENTS_SCHEMA ] ,
133
186
host : { class : 'soba-experience' } ,
@@ -136,6 +189,13 @@ export class SceneGraph {
136
189
protected Math = Math ;
137
190
protected bloom = bloom ;
138
191
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 ) ;
139
199
140
200
asRenderTexture = input ( false ) ;
141
201
}
0 commit comments