Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
js
textures
README.md
app.js
index.html

README.md

day 0011


Move mouse to change view point
[project link](http://caiyuli.com/projects/xDaysOfMaking/d011/)

three.js

北山白云里,隐者自怡悦。

Far in the clouds of north mountain, recluse chill and sing.
## learned today Feb 10th 2017

Practicing the shadow and multiplying objects in three js

MeshStandardMaterial

This approach differs from older approaches in that instead of using approximations for the way in which light interacts with a surface, a physically correct model is used. The idea is that, instead of tweaking materials to look good under specific lighting, a material can be created that will react 'correctly' under all lighting scenarios.
In practice this gives a more accurate and realistic looking result than the MeshLambertMaterial or MeshPhongMaterial, at the cost of being somewhat more computationally expensive.

shadow in three js

Shadows are disabled by default
renderer need to be enabled shadow
mesh objects, plane use ShadowMaterial
PointLight set to be able to cast shadow
need to setClearColor instead of using default black


renderer.setClearColor(0xffcccc);

 renderer.shadowMap.enabled = true;
 renderer.shadowMap.type = THREE.PCFSoftShadowMap;
 

 pointLight.castShadow = true;
 pointLight.shadow.mapSize.width = 1024;
 pointLight.shadow.mapSize.height = 1024;
 

 shapeOne.castShadow = true;
 shapeOne.receiveShadow = true;
 

You can’t perform that action at this time.
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.