Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a72b0e0

Browse files
committed
Merge branch 'dev'
Conflicts: build/three.js build/three.min.js src/core/Object3D.js src/renderers/WebGLRenderer.js
2 parents a93be86 + 6e8b56b commit a72b0e0

File tree

324 files changed

+13134
-5458
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

324 files changed

+13134
-5458
lines changed

docs/api/core/Geometry.html

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,6 @@ <h3>[property:Array morphTargets]</h3>
8888
Morph vertices match number and order of primary vertices.
8989
</div>
9090

91-
<h3>[property:Array morphColors]</h3>
92-
<div>
93-
Array of morph colors. Morph colors have similar structure as morph targets, each color set is a Javascript object:
94-
<code>morphColor = { name: "colorName", colors: [ new THREE.Color(), ... ] }</code>
95-
Morph colors can match either the number and order of faces (face colors) or the number of vertices (vertex colors).
96-
</div>
97-
9891
<h3>[property:Array morphNormals]</h3>
9992
<div>
10093
Array of morph normals. Morph normals have similar structure as morph targets, each normal set is a Javascript object:

docs/api/extras/geometries/TextGeometry.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@ <h2>Available Fonts</h2>
9393
<td>/examples/fonts/gentilis_bold.typeface.js</td>
9494
</tr>
9595
<tr>
96-
<td>driod sans</td>
96+
<td>droid sans</td>
9797
<td>normal</td>
9898
<td>normal</td>
9999
<td>/examples/fonts/droid/droid_sans_regular.typeface.js</td>
100100
</tr>
101101
<tr>
102-
<td>driod sans</td>
102+
<td>droid sans</td>
103103
<td>bold</td>
104104
<td>normal</td>
105105
<td>/examples/fonts/droid/droid_sans_bold.typeface.js</td>

docs/api/lights/DirectionalLight.html

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<meta charset="utf-8" />
4+
<meta charset="utf-8" />
55
<base href="../../" />
66
<script src="list.js"></script>
77
<script src="page.js"></script>
@@ -123,12 +123,6 @@ <h3>[property:Float shadowBias]</h3>
123123
Default — *0*.
124124
</div>
125125

126-
<h3>[property:Float shadowDarkness]</h3>
127-
<div>
128-
Darkness of shadow casted by this light (from *0* to *1*).<br />
129-
Default — *0.5*.
130-
</div>
131-
132126
<h3>[property:Integer shadowMapWidth]</h3>
133127
<div>
134128
Shadow map texture width in pixels.<br />

docs/api/lights/SpotLight.html

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,6 @@ <h3>[property:Float shadowBias]</h3>
146146
Default — *0*.
147147
</div>
148148

149-
<h3>[property:Float shadowDarkness]</h3>
150-
<div>
151-
Darkness of shadow casted by this light (from *0* to *1*).<br />
152-
Default — *0.5*.
153-
</div>
154-
155149
<h3>[property:Integer shadowMapWidth]</h3>
156150
<div>
157151
Shadow map texture width in pixels.<br />

docs/api/loaders/JSONLoader.html

Lines changed: 77 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,78 @@
1-
<!DOCTYPE html>
2-
<html lang="en">
3-
<head>
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
44
<meta charset="utf-8" />
5-
<base href="../../" />
6-
<script src="list.js"></script>
7-
<script src="page.js"></script>
8-
<link type="text/css" rel="stylesheet" href="page.css" />
9-
</head>
10-
<body>
11-
[page:Loader] &rarr;
12-
<h1>[name]</h1>
13-
14-
<div class="desc">A loader for loading objects in JSON format.</div>
15-
16-
17-
<h2>Constructor</h2>
18-
19-
<h3>[name]()</h3>
20-
<div>
21-
Creates a new [name].
22-
</div>
23-
24-
25-
<h2>Properties</h2>
26-
27-
<h3>[property:boolean withCredentials]</h3>
28-
<div>
29-
If true, the ajax request will use cookies.
30-
</div>
31-
32-
33-
<h2>Methods</h2>
34-
35-
<h3>[method:null load]( [page:String url], [page:Function callback], [page:String texturePath] )</h3>
36-
<div>
37-
[page:String url] — required<br />
38-
[page:Function callback] — required. Will be called when load completes. The arguments will be the loaded [page:Object3D] and the loaded [page:Array materials].<br />
39-
[page:String texturePath] — optional. If not specified, textures will be assumed to be in the same folder as the Javascript model file.
40-
</div>
41-
42-
<h3>[method:null loadAjaxJSON]([page:JSONLoader context], [page:String url], [page:Function callback], [page:String texturePath], [page:Function callbackProgress])</h3>
43-
<div>
44-
[page:JSONLoader context] — The [page:JSONLoader] instance<br />
45-
[page:String url] — required<br />
46-
[page:Function callback] — required. This function will be called with the loaded model as an instance of [page:Geometry geometry] when the load is completed.<br />
47-
[page:String texturePath] — Base path for textures.<br />
48-
[page:Function callbackProgress] — Will be called while load progresses. The argument will be an [page:Object] containing two attributes: .[page:Integer total] and .[page:Integer loaded] bytes.
49-
</div>
50-
<div>
51-
Begin loading from url and call <em>callback</em> with the parsed response content.
52-
</div>
53-
54-
<h3>[method:Object3D parse]( [page:Object json], [page:String texturePath] )</h3>
55-
<div>
56-
[page:String json] — JSON object to parse.<br />
57-
[page:String texturePath] — Base path for textures.
58-
</div>
59-
<div>
60-
Parse a <em>JSON</em> structure and return an [page:Object] containing the parsed .[page:Geometry] and .[page:Array materials].
61-
</div>
62-
63-
64-
<h2>Example</h2>
65-
66-
<code>
67-
// instantiate a loader
68-
var loader = new THREE.JSONLoader();
69-
70-
// load a resource
71-
loader.load(
72-
// resource URL
73-
'models/animated/monster/monster.js',
74-
// Function when resource is loaded
75-
function ( geometry, materials ) {
76-
var material = new THREE.MeshFaceMaterial( materials );
77-
var object = new THREE.Mesh( geometry, material );
78-
scene.add( object );
79-
}
80-
);
81-
</code>
82-
83-
[example:webgl_loader_json_blender]
84-
85-
86-
<h2>Source</h2>
87-
88-
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
89-
</body>
90-
</html>
5+
<base href="../../" />
6+
<script src="list.js"></script>
7+
<script src="page.js"></script>
8+
<link type="text/css" rel="stylesheet" href="page.css" />
9+
</head>
10+
<body>
11+
[page:Loader] &rarr;
12+
<h1>[name]</h1>
13+
14+
<div class="desc">A loader for loading objects in JSON format.</div>
15+
16+
17+
<h2>Constructor</h2>
18+
19+
<h3>[name]()</h3>
20+
<div>
21+
Creates a new [name].
22+
</div>
23+
24+
25+
<h2>Properties</h2>
26+
27+
<h3>[property:boolean withCredentials]</h3>
28+
<div>
29+
If true, the ajax request will use cookies.
30+
</div>
31+
32+
33+
<h2>Methods</h2>
34+
35+
<h3>[method:null load]( [page:String url], [page:Function callback], [page:String texturePath] )</h3>
36+
<div>
37+
[page:String url] — required<br />
38+
[page:Function callback] — required. Will be called when load completes. The arguments will be the loaded [page:Object3D] and the loaded [page:Array materials].<br />
39+
[page:String texturePath] — optional. If not specified, textures will be assumed to be in the same folder as the Javascript model file.
40+
</div>
41+
42+
<h3>[method:Object3D parse]( [page:Object json], [page:String texturePath] )</h3>
43+
<div>
44+
[page:String json] — JSON object to parse.<br />
45+
[page:String texturePath] — Base path for textures.
46+
</div>
47+
<div>
48+
Parse a <em>JSON</em> structure and return an [page:Object] containing the parsed .[page:Geometry] and .[page:Array materials].
49+
</div>
50+
51+
52+
<h2>Example</h2>
53+
54+
<code>
55+
// instantiate a loader
56+
var loader = new THREE.JSONLoader();
57+
58+
// load a resource
59+
loader.load(
60+
// resource URL
61+
'models/animated/monster/monster.js',
62+
// Function when resource is loaded
63+
function ( geometry, materials ) {
64+
var material = new THREE.MeshFaceMaterial( materials );
65+
var object = new THREE.Mesh( geometry, material );
66+
scene.add( object );
67+
}
68+
);
69+
</code>
70+
71+
[example:webgl_loader_json_blender]
72+
73+
74+
<h2>Source</h2>
75+
76+
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
77+
</body>
78+
</html>

docs/api/materials/MeshPhongMaterial.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ <h3>[property:Color specular]</h3>
6868
</div>
6969

7070
<h3>[property:Float shininess]</h3>
71-
<div>How shiny the specular highlight is; a higher value gives a sharper highlight. Default is *30*. It should not be set to 0.</div>
71+
<div>How shiny the specular highlight is; a higher value gives a sharper highlight. Default is *30*.</div>
7272

7373
<h3>[property:boolean metal]</h3>
7474
<div>

docs/api/materials/ShaderMaterial.html

Lines changed: 21 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<meta charset="utf-8" />
4+
<meta charset="utf-8" />
55
<base href="../../" />
66
<script src="list.js"></script>
77
<script src="page.js"></script>
@@ -16,9 +16,13 @@ <h1>[name]</h1>
1616
<ul>
1717
<li>implement an effect not included with any of the built-in [page:Material materials]</li>
1818
<li>combine many objects into a single [page:Geometry] or [page:BufferGeometry] in order to improve performance</li>
19-
<li>associate custom data with individual vertices ("custom attributes")</li>
2019
</ul>
21-
Note that a ShaderMaterial will only be rendered properly by [page:WebGLRenderer], since the GLSL code in the vertexShader and fragmentShader properties must be compiled and run on the GPU using WebGL.
20+
There are the following notes to bear in mind when using a *ShaderMaterial*:
21+
22+
<ul>
23+
<li>A *ShaderMaterial* will only be rendered properly by [page:WebGLRenderer], since the GLSL code in the *vertexShader* and *fragmentShader* properties must be compiled and run on the GPU using WebGL.</li>
24+
<li>As of THREE r72, directly assigning attributes in a *ShaderMaterial* is no longer supported. A [page:BufferGeometry] instance (instead of a [page:Geometry] instance) must be used instead, using [page:BufferAttribute] instances to define custom attributes.</li>
25+
</ul>
2226
</div>
2327

2428
<h3>Example</h3>
@@ -67,66 +71,51 @@ <h3>Built-in attributes and uniforms</h3>
6771
</p>
6872

6973
<h3>Custom attributes and uniforms</h3>
70-
Custom attributes and uniforms must be declared both in your GLSL shader code (within *vertexShader* and/or *fragmentShader*), <emph>and</emph> in the *attributes* and *uniforms* properties of your ShaderMaterial. The declaration in the material is necessary to ensure [page:WebGLRenderer] passes your attribute/uniform data in a buffer to the GPU when the shader is run. Note that *varying*s only need to be declared within the shader code (not within the material).
74+
<p>Both custom attributes and uniforms must be declared in your GLSL shader code (within *vertexShader* and/or *fragmentShader*). Custom uniforms must be defined in <emph>both</emph> the *uniforms* property of your *ShaderMaterial*, whereas any custom attributes must be defined via [page:BufferAttribute] instances. Note that *varying*s only need to be declared within the shader code (not within the material).
7175
</p>
72-
<p>
73-
To declare a custom attribute, use the *attributes* property of the material:
74-
<code>
75-
attributes: {
76-
vertexOpacity: { type: 'f', value: [] }
77-
}
78-
</code>
79-
Each attribute must have a *type* property and a *value* property.
76+
77+
<p>To declare a custom attribute, please reference the [page:BufferGeometry] page for an overview, and the [page:BufferAttribute] page for a detailed look at the *BufferAttribute* API.</p>
78+
<p>When creating your attributes, each typed array that you create to hold your attribute's data must be a multiple of your data type's size. For example, if your attribute is a [page:Vector3 THREE.Vector3] type, and you have 3000 vertices in your [page:BufferGeometry], your typed array value must be created with a length of 3000 * 3, or 9000 (one value per-component). A table of each data type's size is shown below for reference:</p>
79+
8080
<table>
81-
<caption><a id="attribute-types">Attribute types</a></caption>
81+
<caption><a id="attribute-sizes">Attribute sizes</a></caption>
8282
<thead>
8383
<tr>
84-
<th>Attribute *type* string</th>
8584
<th>GLSL type</th>
8685
<th>JavaScript type</th>
86+
<th>Size</th>
8787
</tr>
8888
</thead>
8989
<tbody>
9090
<tr>
91-
<td><code>'f'</code></td>
9291
<td>float</td>
9392
<td>[page:Number]</td>
93+
<td>1</td>
9494
</tr>
9595
<tr>
96-
<td><code>'v2'</code></td>
9796
<td>vec2</td>
9897
<td>[page:Vector2 THREE.Vector2]</td>
98+
<td>2</td>
9999
</tr>
100100
<tr>
101-
<td><code>'v3'</code></td>
102101
<td>vec3</td>
103102
<td>[page:Vector3 THREE.Vector3]</td>
103+
<td>3</td>
104104
</tr>
105105
<tr>
106-
<td><code>'c'</code></td>
107106
<td>vec3</td>
108107
<td>[page:Color THREE.Color]</td>
108+
<td>3</td>
109109
</tr>
110110
<tr>
111-
<td><code>'v4'</code></td>
112111
<td>vec4</td>
113112
<td>[page:Vector4 THREE.Vector4]</td>
113+
<td>4</td>
114114
</tr>
115115
</tbody>
116116
</table>
117-
The way attribute data is stored depends on whether you're using [page:BufferGeometry] or [page:Geometry]:
118-
<ul>
119-
<li>When using [page:Geometry], attribute data is stored directly on the <emph>material</emph>, using the attribute's *value* array; each element of *value* should correspond to one vertex. To update an attribute, set the *needsUpdate* flag to true on the material attribute:
120-
<code>
121-
material.attributes.vertexOpacity.needsUpdate = true;
122-
</code>
123-
</li>
124-
<li>When using [page:BufferGeometry], attribute data is stored within a [page:BufferAttribute] on the geometry itself, and the *value* within the material is ignored. To update an attribute, set the *needsUpdate* flag to true on the [page:BufferAttribute] of the geometry:
125-
<code>
126-
geometry.attributes.vertexOpacity.needsUpdate = true;
127-
</code>
128-
See [page:BufferGeometry] for details.</li>
129-
</ul>
117+
118+
Note that attribute buffers are <emph>not</emph> refreshed automatically when their values change. To update custom attributes, set the *needsUpdate* flag to true on the [page:BufferAttribute] of the geometry (see [page:BufferGeometry] for further details).
130119
</p>
131120

132121
<p>
@@ -232,20 +221,6 @@ <h3>[property:Object uniforms]</h3>
232221
where *type* is a <a href="#uniform-types">uniform type string</a>, and *value* is the value of the uniform. Names must match the name of the uniform, as defined in the GLSL code. Note that uniforms are refreshed on every frame, so updating the value of the uniform will immediately update the value available to the GLSL code.
233222
</div>
234223

235-
<h3>[property:Object attributes]</h3>
236-
<div>
237-
<p>
238-
Object specifying the custom attributes to be passed to the shader code; keys are attribute names, values are definitions of the form
239-
<code>
240-
{ type: 'f', value: [1.0, 0.5, 2.0, ...] }
241-
</code>
242-
where *type* is an <a href="#attribute-types">attribute type string</a>, and *value* is an array containing an attribute value for each vertex in the geometry (or *undefined* if using [page:BufferGeometry]). Names must match the name of the attribute, as defined in the GLSL code.
243-
</p>
244-
<p>
245-
Note that attribute buffers are <emph>not</emph> refreshed automatically when their values change; if using [page:Geometry], set <code>needsUpdate = true</code> on the attribute definition. If using [page:BufferGeometry], set <code>needsUpdate = true</code> on the [page:BufferAttribute].
246-
</p>
247-
</div>
248-
249224
<h3>[property:Object defines]</h3>
250225
<div>
251226
Defines custom constants using *#define* directives within the GLSL code for both the vertex shader and the fragment shader; each key/value pair yields another directive:

0 commit comments

Comments
 (0)