File tree 2 files changed +61
-0
lines changed
2 files changed +61
-0
lines changed Original file line number Diff line number Diff line change
1
+ import * as Nodes from 'three/examples/jsm/nodes/Nodes' ;
2
+
3
+ import {
4
+ Effect , Input , InputDimension
5
+ } from '../EffectBlock' ;
6
+
7
+ import {
8
+ Block
9
+ } from '../Block' ;
10
+
11
+ import {
12
+ Component
13
+ } from '../Data' ;
14
+
15
+ import {
16
+ NodeOperation
17
+ } from '../NodeMesh' ;
18
+
19
+ import {
20
+ IdentityNode
21
+ } from '../utils/Nodes' ;
22
+
23
+
24
+ export
25
+ class RGB extends Effect {
26
+
27
+ constructor ( parent : Block , input : Input ) {
28
+ super ( parent , input ) ;
29
+
30
+ this . colorNode = new IdentityNode ( this . inputNode ) ;
31
+
32
+ this . addColorNode ( NodeOperation . ASSIGN , this . colorNode ) ;
33
+
34
+ this . buildMaterial ( ) ;
35
+
36
+ this . initialized = true ;
37
+ }
38
+
39
+ setInput ( input ?: Input ) : void {
40
+ super . setInput ( input ) ;
41
+
42
+ if ( this . initialized ) {
43
+ this . colorNode . value = this . inputNode ;
44
+
45
+ this . buildMaterial ( ) ;
46
+ }
47
+ }
48
+
49
+ get inputDimension ( ) : InputDimension {
50
+ return 3 ;
51
+ }
52
+
53
+ private initialized : boolean = false ;
54
+
55
+ private colorNode : IdentityNode ;
56
+
57
+ protected inputs : [ Component ] ;
58
+ protected inputNode : Nodes . Node ;
59
+
60
+ }
Original file line number Diff line number Diff line change 1
1
export * from './Alpha' ;
2
+ export * from './RGB' ;
2
3
3
4
export * from './IsoColor' ;
4
5
You can’t perform that action at this time.
0 commit comments