Materials & Environment
Materials define how a surface responds to light. MeshStandardMaterial is the physically-based workhorse — roughness and metalness control everything from matte plastic to chrome.
MeshStandardMaterial
const material = new THREE.MeshStandardMaterial({
color: 0xffffff,
metalness: 0.9,
roughness: 0.1,
});
Needs light to show anything. Add a point light:
const light = new THREE.PointLight(0xffffff, 2);
light.position.set(2, 3, 4);
scene.add(light);
Environment Map
An HDR environment map acts as an infinite light source and reflection source:
import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
new RGBELoader().load('/hdr/studio.hdr', (texture) => {
texture.mapping = THREE.EquirectangularReflectionMapping;
scene.environment = texture;
scene.background = texture;
});
What to Experiment With
- Slide
roughness0→1: mirror → matte - Slide
metalness0→1: plastic → chrome - Try
MeshPhysicalMaterialwithtransmission: 1, thickness: 0.5for glass
재질은 표면이 빛에 반응하는 방식을 정의합니다. MeshStandardMaterial은 물리 기반 핵심 재질로, roughness와 metalness로 무광 플라스틱부터 크롬까지 모든 것을 제어합니다.
MeshStandardMaterial
const material = new THREE.MeshStandardMaterial({
color: 0xffffff,
metalness: 0.9,
roughness: 0.1,
});
표시되려면 빛이 필요합니다. 포인트 라이트를 추가합니다:
const light = new THREE.PointLight(0xffffff, 2);
light.position.set(2, 3, 4);
scene.add(light);
환경 맵
HDR 환경 맵은 무한한 광원과 반사 소스 역할을 합니다:
import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
new RGBELoader().load('/hdr/studio.hdr', (texture) => {
texture.mapping = THREE.EquirectangularReflectionMapping;
scene.environment = texture;
scene.background = texture;
});
실험해보기
roughness를 0→1로 슬라이드: 거울 → 무광metalness를 0→1로 슬라이드: 플라스틱 → 크롬MeshPhysicalMaterial에transmission: 1, thickness: 0.5를 사용해 유리 효과