1/32
https://drive.google.com/file/d/1lyzAlYFn_m24J8BwkA58KyRlPYh-2k7F/view?usp=sharing
What are textures?
Textures are maps that affect the geometry in terms of:
light refraction
visibility, grayscale
vertex displacement.
Which texture map is notably purple?
Normal maps, because they use RGB color channels to store 3D direction vectors.
What texture maps fall under PBR or physics based rendering?
Metalness
Roughness
Which texture map is notably dependent on elevation to change vertices?
Height map. A subdivision dependent pixel brightness dictated by elevation.
What is Albedo?
Albedo is a texture map referencing the base color of a GM tree without lighting or shading.
What five texture maps fall under grayscale?
Alpha (white vis, black invis)
Height (white higher, black lower)
Ambient occlusion (fake shadows dark)
Metal (white metal, black non)
Roughness (white no light dissipation, black little light reflection)
What is the purpose of alpha texture map?
Boolean as white means visible, black means invisible.
What is the purpose of ambient occlusion?
Fake shadow in crevices, though not physically accurate.
What is the purpose of height?
Subdivision dependent, pixel brightness by elevation.
What is the purpose of metal-ness?
Metallic, white, black, non-metallic helps create reflection.
What texture maps fall under light refraction?
Normals, as it affects light orientation.
Roughness as it dictates little or a lot of light refraction. Example, a little would be water shining, a lot would be carpet and light.
What does PBR stand for? And what texture maps fall under it?
It stands for physics-based rendering to mimic real life. Metalness and roughness fall under this.
How do you initialize a texture loader with a loading manager?
const loadingManager = new THREE.LoadingManager();
// Loading manager states
// e.g., loadingManager.onStart = () => {}
const loadingTexture = new THREE.TextureLoader(loadingManager);
What is the point of the loading manager?
Gives states of texture, more detailed than just boolean of texture loader.
What is the point of minmapping?
Minmapping divides the texture size by powers of twos so that there is a texture for varying sized geometries when further/closer to camera.
Why is it best practice to have power-of-two texture maps?
Although WebGL2 does support non-power-of-two maps, its best practice in the case of using WebGL1.
What is the maximum size resolution that a texture should be?
Size 4096.
Is texture loader and texture a synchronous or asynchronous function? Write the parameters for both.
It is an asynchronous process
Synchronous: export default function LoadingManager({url}:Parameter) {}
Asynchronous: export default async function LoadingManager({url}:Paramer): Promise<THREE.Texture | null> {}
How does the syntax let texture: THREE.Texture<HTMLImageElement>; work?
NOTHING YET
How does the syntax if (!THREE.MathUtils.isPowerOfTwo(width)) work on a high level?
If width % 4 = 0, as 2²=4
Which filter is seen in both minificiation and magnification?
THREE.NearestFilter
How do you cause a moire pattern from the example?
Placing a THREE.NearestFilter on a perfectly sized checkered texture?
What causes a moire pattern in Three.js?
High-frequency textures: too many details squished into tiny pixels
Screen Pixels are like a checkerboard grid, squeezing a shirt with thousands of microscopic stripes makes a computer confuse on which pixel should be a colored or a space creating wavy bands.
No min-mapping
Anisotropy: “ Not the same in all directions”, when surface are tilted away such as a long highway stretching pixels become long oval across textures.
why does a checkered texture on a perfect cube cause Moire pattern?
3.nearest filter, disabled blending interpolation in min-mapping
what is a caveat of 3.nearest filter?
disable mini mapping
can deactivate by texture.generate mini maps false
() => { // argument 2: the callback ("onLoad")
renderer.render(scene, camera);
}What is this function called?
A callback function.
textureLoader.load(
'/textures/minecraft.png', // argument 1: the path
() => { // argument 2: the callback ("onLoad")
renderer.render(scene, camera);
}
);What is the point of this callback function?
It redraws the scene with renderer.render after the asynchronous image is loaded.
This is also seen in the model load for GLTF.
When are magnification filters used?
When the default texture size cannot fill, the face of the mesh, texture grows.
When are minification filters used?
When The default texture size is too big for the mesh face.

TO ADD LATER

Although we used the THREE.NearestFilter here, the texture map is still blurry. From this practice, what did we learn?
I forgot to set the renderer's size to match that of the canvas.
As a result, it draws the buffer size as a default of 300 by 150. Smaller than the CSS canvas display size of 100vw x 100 vh.
What does minmapping do to the texture exactly?
It combines by averaging the pixel values for each smaller MIP level.

In this example, we use texture.magFilter = NearestMinMapNearestFilter , and it doesn’t provide the same result as texture.magFilter = NearestFilter . Why is that?
Although the first filter does apply nearest filter, it is choosing a mip level that closely resembles the size of the mesh. Since it is a small object, it chooses a heavily averaged down mip map.