1 | <!DOCTYPE html>
|
---|
2 | <html lang="en">
|
---|
3 | <head>
|
---|
4 | <meta charset="utf-8" />
|
---|
5 | <script src="../../list.js"></script>
|
---|
6 | <script src="../../page.js"></script>
|
---|
7 | <link type="text/css" rel="stylesheet" href="../../page.css" />
|
---|
8 | </head>
|
---|
9 | <body>
|
---|
10 | [page:Object3D] → [page:Light] →
|
---|
11 |
|
---|
12 | <h1>[name]</h1>
|
---|
13 |
|
---|
14 | <div class="desc">
|
---|
15 | Affects objects using [page:MeshLambertMaterial] or [page:MeshPhongMaterial].
|
---|
16 | </div>
|
---|
17 |
|
---|
18 |
|
---|
19 | <h2>Example</h2>
|
---|
20 |
|
---|
21 | <code>// White directional light at half intensity shining from the top.
|
---|
22 |
|
---|
23 | var directionalLight = new THREE.DirectionalLight( 0xffffff, 0.5 );
|
---|
24 | directionalLight.position.set( 0, 1, 0 );
|
---|
25 | scene.add( directionalLight );</code>
|
---|
26 |
|
---|
27 |
|
---|
28 | <h2>Constructor</h2>
|
---|
29 |
|
---|
30 |
|
---|
31 | <h3>[name]([page:Integer hex], [page:Float intensity])</h3>
|
---|
32 | <div>
|
---|
33 | [page:Integer hex] -- Numeric value of the RGB component of the color. <br />
|
---|
34 | [page:Float intensity] -- Numeric value of the light's strength/intensity.
|
---|
35 | </div>
|
---|
36 | <div>
|
---|
37 | Creates a light that shines from a specific direction not from a specific position. This light will behave
|
---|
38 | as though it is infinitely far away and the rays produced from it are all parallel. The best
|
---|
39 | analogy would be a light source that acts like the sun: the sun is so far away that all sunlight
|
---|
40 | hitting objects comes from the same angle.
|
---|
41 | </div>
|
---|
42 |
|
---|
43 | <h2>Properties</h2>
|
---|
44 |
|
---|
45 | <h3>.[page:Object3D target]</h3>
|
---|
46 | <div>
|
---|
47 | Target used for shadow camera orientation.
|
---|
48 | </div>
|
---|
49 |
|
---|
50 | <h3>.[page:Float intensity]</h3>
|
---|
51 | <div>
|
---|
52 | Light's intensity.<br />
|
---|
53 | Default â *1.0*.
|
---|
54 | </div>
|
---|
55 |
|
---|
56 | <h3>.[page:Boolean onlyShadow]</h3>
|
---|
57 | <div>
|
---|
58 | If set to *true* light will only cast shadow but not contribute any lighting (as if *intensity* was 0 but cheaper to compute).<br />
|
---|
59 | Default â *false*.
|
---|
60 | </div>
|
---|
61 |
|
---|
62 | <h3>.[page:Float shadowCameraNear]</h3>
|
---|
63 | <div>
|
---|
64 | Orthographic shadow camera frustum parameter.<br />
|
---|
65 | Default â *50*.
|
---|
66 | </div>
|
---|
67 |
|
---|
68 | <h3>.[page:Float shadowCameraFar]</h3>
|
---|
69 | <div>
|
---|
70 | Orthographic shadow camera frustum parameter.<br />
|
---|
71 | Default â *5000*.
|
---|
72 | </div>
|
---|
73 |
|
---|
74 | <h3>.[page:Float shadowCameraLeft]</h3>
|
---|
75 | <div>
|
---|
76 | Orthographic shadow camera frustum parameter.<br />
|
---|
77 | Default â *-500*.
|
---|
78 | </div>
|
---|
79 |
|
---|
80 | <h3>.[page:Float shadowCameraRight]</h3>
|
---|
81 | <div>
|
---|
82 | Orthographic shadow camera frustum parameter.<br />
|
---|
83 | Default â *500*.
|
---|
84 | </div>
|
---|
85 |
|
---|
86 | <h3>.[page:Float shadowCameraTop]</h3>
|
---|
87 | <div>
|
---|
88 | Orthographic shadow camera frustum parameter.<br />
|
---|
89 | Default â *500*.
|
---|
90 | </div>
|
---|
91 |
|
---|
92 | <h3>.[page:Float shadowCameraBottom]</h3>
|
---|
93 | <div>
|
---|
94 | Orthographic shadow camera frustum parameter.<br />
|
---|
95 | Default â *-500*.
|
---|
96 | </div>
|
---|
97 |
|
---|
98 | <h3>.[page:Boolean shadowCameraVisible]</h3>
|
---|
99 | <div>
|
---|
100 | Show debug shadow camera frustum.<br />
|
---|
101 | Default â *false*.
|
---|
102 | </div>
|
---|
103 |
|
---|
104 | <h3>.[page:Float shadowBias]</h3>
|
---|
105 | <div>
|
---|
106 | Shadow map bias.<br />
|
---|
107 | Default â *0*.
|
---|
108 | </div>
|
---|
109 |
|
---|
110 | <h3>.[page:Float shadowDarkness]</h3>
|
---|
111 | <div>
|
---|
112 | Darkness of shadow casted by this light (from *0* to *1*).<br />
|
---|
113 | Default â *0.5*.
|
---|
114 | </div>
|
---|
115 |
|
---|
116 | <h3>.[page:Integer shadowMapWidth]</h3>
|
---|
117 | <div>
|
---|
118 | Shadow map texture width in pixels.<br />
|
---|
119 | Default â *512*.
|
---|
120 | </div>
|
---|
121 |
|
---|
122 | <h3>.[page:Integer shadowMapHeight]</h3>
|
---|
123 | <div>
|
---|
124 | Shadow map texture height in pixels.<br />
|
---|
125 | Default â *512*.
|
---|
126 | </div>
|
---|
127 |
|
---|
128 | <h3>.[page:Boolean shadowCascade]</h3>
|
---|
129 | <div>
|
---|
130 | ??? <br />
|
---|
131 | Default â *false*.
|
---|
132 | </div>
|
---|
133 |
|
---|
134 | <h3>.[page:Vector3 shadowCascadeOffset]</h3>
|
---|
135 | <div>
|
---|
136 | ??? <br />
|
---|
137 | Default â *Three.Vector3( 0, 0, -1000 )*.
|
---|
138 | </div>
|
---|
139 |
|
---|
140 | <h3>.[page:Integer shadowCascadeCount]</h3>
|
---|
141 | <div>
|
---|
142 | ??? <br />
|
---|
143 | Default â *2*.
|
---|
144 | </div>
|
---|
145 |
|
---|
146 | <h3>.[page:Array shadowCascadeBias]</h3>
|
---|
147 | <div>
|
---|
148 | ??? <br />
|
---|
149 | Default â <strong>[ 0, 0, 0 ]</strong>.
|
---|
150 | </div>
|
---|
151 |
|
---|
152 | <h3>.[page:Array shadowCascadeWidth]</h3>
|
---|
153 | <div>
|
---|
154 | ??? <br />
|
---|
155 | Default â <strong>[ 512, 512, 512 ]</strong>.
|
---|
156 | </div>
|
---|
157 |
|
---|
158 | <h3>.[page:Array shadowCascadeHeight]</h3>
|
---|
159 | <div>
|
---|
160 | ??? <br />
|
---|
161 | Default â <strong>[ 512, 512, 512 ]</strong>.
|
---|
162 | </div>
|
---|
163 |
|
---|
164 | <h3>.[page:Array shadowCascadeNearZ]</h3>
|
---|
165 | <div>
|
---|
166 | ??? <br />
|
---|
167 | Default â <strong>[ -1.000, 0.990, 0.998 ]</strong>.
|
---|
168 | </div>
|
---|
169 |
|
---|
170 | <h3>.[page:Array shadowCascadeFarZ]</h3>
|
---|
171 | <div>
|
---|
172 | ??? <br />
|
---|
173 | Default â <strong>[ 0.990, 0.998, 1.000 ]</strong>.
|
---|
174 | </div>
|
---|
175 |
|
---|
176 | <h3>.[page:Array shadowCascadeArray]</h3>
|
---|
177 | <div>
|
---|
178 | ??? <br />
|
---|
179 | Default â <strong>[ ]</strong>.
|
---|
180 | </div>
|
---|
181 |
|
---|
182 | <h3>.[page:RenderTarget shadowMap]</h3>
|
---|
183 | <div>
|
---|
184 | ??? <br />
|
---|
185 | Default â *null*.
|
---|
186 | </div>
|
---|
187 |
|
---|
188 | <h3>.[page:Integer shadowMapSize]</h3>
|
---|
189 | <div>
|
---|
190 | ??? <br />
|
---|
191 | Default â *null*.
|
---|
192 | </div>
|
---|
193 |
|
---|
194 | <h3>.[page:Camera shadowCamera]</h3>
|
---|
195 | <div>
|
---|
196 | ??? <br />
|
---|
197 | Default â *null*.
|
---|
198 | </div>
|
---|
199 |
|
---|
200 | <h3>.[page:Matrix shadowMatrix]</h3>
|
---|
201 | <div>
|
---|
202 | ??? <br />
|
---|
203 | Default â *null*.
|
---|
204 | </div>
|
---|
205 |
|
---|
206 | <h2>Methods</h2>
|
---|
207 |
|
---|
208 |
|
---|
209 | <h2>Source</h2>
|
---|
210 |
|
---|
211 | [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
|
---|
212 | </body>
|
---|
213 | </html>
|
---|