@@ -19,28 +19,18 @@ class BasicNode extends Node {
19
19
20
20
const position = this . position ? this . position . analyzeAndFlow ( builder , 'v3' , { cache : 'position' } ) : undefined ;
21
21
22
- builder . addParsCode ( /* glsl */ `
23
- varying vec3 vViewPosition;
24
-
25
- #ifndef FLAT_SHADED
26
-
27
- varying vec3 vNormal;
28
-
29
- #endif`
30
- ) ;
31
22
32
23
const output = [
33
24
'#include <beginnormal_vertex>' ,
34
- '#include <defaultnormal_vertex>' ,
35
-
36
- '#ifndef FLAT_SHADED' , // Normal computed with derivatives when FLAT_SHADED
37
-
38
- ' vNormal = normalize( transformedNormal );' ,
25
+ '#include <morphnormal_vertex>' ,
26
+ '#include <skinnormal_vertex>' ,
27
+ '#include <defaultnormal_vertex>'
28
+ ] ;
39
29
40
- '#endif' ,
30
+ output . push (
31
+ '#include <begin_vertex>'
41
32
42
- '#include <begin_vertex>' ,
43
- ] ;
33
+ ) ;
44
34
45
35
if ( position ) {
46
36
@@ -55,14 +45,11 @@ class BasicNode extends Node {
55
45
'#include <morphtarget_vertex>' ,
56
46
'#include <skinning_vertex>' ,
57
47
'#include <project_vertex>' ,
58
- '#include <fog_vertex>' ,
59
48
'#include <logdepthbuf_vertex>' ,
60
- '#include <clipping_planes_vertex>' ,
61
-
62
- ' vViewPosition = - mvPosition.xyz;' ,
63
49
64
50
'#include <worldpos_vertex>' ,
65
- '#include <shadowmap_vertex>'
51
+ '#include <clipping_planes_vertex>' ,
52
+ '#include <fog_vertex>' ,
66
53
) ;
67
54
68
55
code = output . join ( '\n' ) ;
@@ -82,21 +69,8 @@ class BasicNode extends Node {
82
69
83
70
builder . requires . transparent = alpha !== undefined ;
84
71
85
- builder . addParsCode ( /* glsl */ `
86
- varying vec3 vViewPosition;
87
-
88
- #ifndef FLAT_SHADED
89
-
90
- varying vec3 vNormal;
91
-
92
- #endif`
93
- ) ;
94
-
95
72
const output = [
96
- // add before: prevent undeclared normal
97
- '#include <normal_fragment_begin>' ,
98
-
99
- color . code ,
73
+ color . code
100
74
] ;
101
75
102
76
if ( mask ) {
0 commit comments