Skip to content

Commit

Permalink
add rendering test for shadow (#3564)
Browse files Browse the repository at this point in the history
  • Loading branch information
jianhuang01 committed Sep 11, 2019
1 parent 67f3b7c commit 6a47edb
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 53 additions & 1 deletion test/render/test-cases.js
Expand Up @@ -12,7 +12,10 @@ import {
OrbitView,
OrthographicView,
FirstPersonView,
PostProcessEffect
PostProcessEffect,
LightingEffect,
AmbientLight,
DirectionalLight
} from '@deck.gl/core';
import {noise, vignette} from '@luma.gl/effects';

Expand Down Expand Up @@ -865,6 +868,55 @@ export const TEST_CASES = [
],
goldenImage: './test/render/golden-images/column-lnglat.png'
},
{
name: 'column-shadow-lnglat',
effects: [
new LightingEffect({
ambientLight: new AmbientLight({
color: [255, 255, 255],
intensity: 1.0
}),
dirLight: new DirectionalLight({
color: [255, 255, 255],
intensity: 1.0,
direction: [-10, -2, -15],
_shadow: true
})
})
],
viewState: {
latitude: 37.751537058389985,
longitude: -122.42694203247012,
zoom: 11.5,
pitch: 30,
bearing: 0,
orthographic: true
},
layers: [
new ColumnLayer({
id: 'column-lnglat',
data: dataSamples.hexagons,
radius: 250,
angle: Math.PI / 2,
coverage: 1,
extruded: true,
pickable: true,
opacity: 1,
shadowEnabled: false,
getPosition: h => h.centroid,
getFillColor: h => [48, 128, h.value * 255, 255],
getElevation: h => h.value * 5000
}),
new HexagonLayer(
Object.assign({}, HEXAGON_LAYER_INFO.props, {
id: 'hexagon-lnglat',
getColorValue,
getElevationValue
})
)
],
goldenImage: './test/render/golden-images/column-shadow-lnglat.png'
},
{
name: 'column-lnglat-stroke',
viewState: {
Expand Down

0 comments on commit 6a47edb

Please sign in to comment.