You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
前面的例子里 render 只是一个静态的结果,想要让 3D 能动起来,需要使用 `window.requestAnimationFrame` 持续进行 render
78
+
前面的例子里 render 只是一个静态的结果,想要让 3D 能动起来或者可以交互,需要使用 `window.requestAnimationFrame` 持续进行 render
79
79
80
80
fps = frames per seconds
81
81
@@ -158,6 +158,11 @@ const positionsAttribute = new THREE.BufferAttribute(positionsArray, 3)
158
158
159
159
## Textures
160
160
161
+
> Textures, as you probably know, are images that will cover the surface of your geometries. Many types of textures can have different effects on the appearance of your geometry. It's not just about the color.
- lure(诱骗诱使) the *light* about the face orientation
175
180
- better performances than adding a height texture with a lot if subdivision
176
181
- ambient occlusion
177
-
- grayscale
178
-
- add fake shadows in crevices
179
-
- metalness
182
+
- grayscale image
183
+
- add fake shadows in the surface's crevices(裂缝)
184
+
- 不一定准确,但是能造出 contrast
185
+
- metalness 金属质感
180
186
- grayscale
181
187
- white is metallic, black is not
182
188
- mostly for reflection
183
-
- roughness
189
+
- roughness 粗糙度
184
190
- grayscale
185
191
- in duo with the metalness
186
192
- white is rough
187
193
- black is smooth
188
-
- mostly for light dissipation
194
+
- mostly for light dissipation(消散)
195
+
- 举例来说,比如地毯非常粗糙,所以基本看不到光线反射,但水面就很光滑,肯定需要有光线反射效果
189
196
190
197
**PBR principle** (especially the metalness and the roughness):
191
198
- physical based rendering
@@ -195,35 +202,167 @@ mostly used types:
195
202
- [Physically-Based Rendering, And You Can Too! | Marmoset](https://marmoset.co/posts/physically-based-rendering-and-you-can-too/)
196
203
197
204
198
-
filtering and mipmapping: a technique that consists of creating half a smaller version of a texture again and again until you get a 1x1 texture. All those texture variations are sent to the GPU, and the GPU will choose the most appropriate version of the texture.
205
+
### Load Texture
206
+
207
+
主要就是使用 [TextureLoader](https://threejs.org/docs/#api/en/loaders/TextureLoader),然后设置在 material 上即可看到效果。
> texture is being stretched or squeezed in different ways to cover the geometry.
220
+
221
+
> That is called UV unwrapping. You can imagine that like unwrapping an origami or a candy wrap to make it flat. Each vertex will have a 2D coordinate on a flat (usually square) plane.
// texture not being set up to repeat itself by default. To change that, you have to update the wrapS and wrapT properties using the THREE.RepeatWrapping constant.
234
+
colorTexture.wrapS=THREE.RepeatWrapping// for x-axis
235
+
colorTexture.wrapT=THREE.RepeatWrapping// for y-axis
236
+
```
237
+
238
+
### Filtering and Mipmapping
239
+
240
+
> Mipmapping is a technique that consists of creating half a smaller version of a texture again and again until you get a 1x1 texture. All those texture variations are sent to the GPU, and the GPU will choose the most appropriate version of the texture.
241
+
199
242
主要是为了处理毛边,blurring
200
243
244
+
> Minification filter happens when the pixels of texture are smaller than the pixels of the render.
are used to put a color on each visible pixel of the geometries
216
-
The algorithms that decide on the color of each pixel are written in programs called **shaders**. Writing shaders is one of the most challenging parts of WebGL and Three.js, but don't worry; Three.js has many built-in materials with pre-made shaders.
281
+
> Material are used to put a color on each visible pixel of the geometries.
217
282
218
-
Normals material:
219
-
"Normals" are information encoded in each vertex that contains the direction of the outside of the face
283
+
> The algorithms that decide on the color of each pixel are written in programs called **shaders**. Writing shaders is one of the most challenging parts of WebGL and Three.js, but don't worry; Three.js has many built-in materials with pre-made shaders.
220
284
221
-
Huge library of matcap
222
-
[GitHub - nidorx/matcaps: Huge library of matcap PNG textures organized by color](https://github.com/nidorx/matcaps)
0 commit comments