dev-docs/RFCs/v7.0/phong-lighting-rfc.md
Lighting is an important rendering effects in deck.gl, the current lighting module has some issues.
Three light source classes specify light source details for the scene
LightPhongMaterial class specify phong model based lighting material details for each layer
LightingEffect class holds and manages all the light sources
Blinn phong model will be implemented in the shader module to calculate the actual light weight
Create light sources
const directionalLight = new DirectionalLight( 0xffffff, 0.5, [1, 0, 0]);
const pointLight = new PointLight( 0xffffff, 0.5, [0, 0, 0]);
Create lighting effect
const lightingEffect = new LightingEffect({pointLight, directionalLight}])
Create material
const phongMeterial = new LightPhongMeterial(0.3, 0.5, 32, [255, 255, 255, 255])
Create deck and layer
const deck = new Deck({
effects: [lightingEffect],
layers: [
new GeoJsonLayer({
data: US_MAP_GEOJSON,
stroked: true,
filled: true,
getLineColor: [255, 100, 100],
getFillColor: [200, 160, 0, 180],
material:phongMeterial
}
})
]});
Lighting implemented with PBR models