Recommended: Add NSDT Scene Editor to your 3D toolchainOther series of tools: NSDT Jianshi digital twinSpecular Mesh Material Phong
The specular mesh material is the same as
MeshPhongMaterial
the base mesh materialMeshBasicMaterial
and the diffuse mesh materialMeshLambertMaterial
are the materials of the mesh modelMesh
.The specular mesh material MeshPhongMaterial is affected by lighting just like the diffuse mesh material MeshLambertMaterial.
MeshPhongMaterial
Light reflection characteristics
MeshPhongMaterial
The difference between them andMeshLambertMaterial
both will be affected by light is that there are differences in the way light is reflected.
MeshPhongMaterial
MeshLambertMaterial
Specular reflection effects that cannot be achieved can be achieved . For the highlight effect, you can imagine that you observe a car under the sun, and you will find that at a specific angle and position, you can see a certain local area on the surface of the car is very bright.Specular vs Diffuse
MeshPhongMaterial
It can provide a specular reflection effect, which can be compared to taking a mirror in your life, placing it under the sunlight, adjusting the angle, and reflecting the sunlight to other places. If the reflected light is facing the eyes, that is, when the reflected light is parallel to the line of sight , will be very dazzling.
MeshLambertMaterial
The corresponding Mesh is illuminated by light, without the effect of specular reflection, but just a diffuse reflection, that is, the light reflects around.Highlight properties
.shininess
Through the
MeshPhongMaterial
specular brightness.shininess
property, you can control the specular reflection effect.// 模拟镜面反射,产生一个高光效果 const material = new THREE.MeshPhongMaterial({ color: 0xff0000, shininess: 20, //高光部分的亮度,默认30 });
Specular Color Properties
.specular
.specular
You can set different values for the color property , for example0x444444
,0xfffffff
to view the rendering effect changes.// 模拟镜面反射,产生一个高光效果 const material = new THREE.MeshPhongMaterial({ color: 0xff0000, shininess: 20, //高光部分的亮度,默认30 specular: 0x444444, //高光部分的颜色 });
Previous: Three.js Tutorial: Introduction to Threejs Common Geometries (mvrlink.com)
Next: Three.js Tutorial: WebGL Renderer Settings (Jagged Blur) (mvrlink.com)
Three.js Tutorial: Specular Mesh Material Phong
Guess you like
Origin blog.csdn.net/ygtu2018/article/details/131351356
Recommended
Ranking