Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add lighting effect docs #2786

Merged
merged 12 commits into from Mar 13, 2019

Conversation

Projects
None yet
5 participants
@jianhuang01
Copy link
Contributor

jianhuang01 commented Mar 12, 2019

For #2096

Change List

  • Add lighting effect doc
  • Change lightSettings to material

@jianhuang01 jianhuang01 added the doc label Mar 12, 2019

@jianhuang01 jianhuang01 requested review from Pessimistress and ibgreen Mar 12, 2019

jianhuang01 added some commits Mar 12, 2019

@coveralls

This comment has been minimized.

Copy link

coveralls commented Mar 12, 2019

Coverage Status

Coverage decreased (-0.06%) to 58.721% when pulling b9e304b on lighting-docs into 307b847 on master.

jianhuang01 added some commits Mar 12, 2019

Show resolved Hide resolved docs/layers/geojson-layer.md Outdated

@ibgreen ibgreen requested a review from georgios-uber Mar 12, 2019

@georgios-uber

This comment has been minimized.

Copy link
Contributor

georgios-uber commented Mar 12, 2019

jianhuang01 added some commits Mar 12, 2019

// create ambient light source
const ambientLight = new AmbientLight({
color: [255, 255, 255],
intensity: 1.0});

This comment has been minimized.

Copy link
@Pessimistress

Pessimistress Mar 12, 2019

Contributor

format


```js
import DeckGL, {GeoJsonLayer, LightingEffect} from '@deck.gl/core';
import {AmbientLight, PointLight, DirectionalLight, PhongMaterial} from 'luma.gl';

This comment has been minimized.

Copy link
@Pessimistress

Pessimistress Mar 12, 2019

Contributor

@luma.gl/core

Show resolved Hide resolved docs/effects/lighting-effect.md
const lightingEffect = new LightingEffect({ambientLight, pointLight, directionalLight});
export const INITIAL_VIEW_STATE = {

This comment has been minimized.

Copy link
@Pessimistress

Pessimistress Mar 12, 2019

Contributor

Define inline

// lighting only applies to extruded polygons
extruded: true,
// specify material properties per layer
material: new PhongMaterial({

This comment has been minimized.

Copy link
@Pessimistress

Pessimistress Mar 12, 2019

Contributor

Is this going to affect perf? Should the material be defined as a constant?

## Remarks

* Point light position uses the same coordinate system as view state.
* Lighting need both effect per deck and material per layer, here is the list of layers which support lighting

This comment has been minimized.

Copy link
@Pessimistress

Pessimistress Mar 12, 2019

Contributor

To enable lighting on a layer, it is required that both the effects prop of Deck (link to deck documentation) and the material prop of the layer are specified. Refer to each layer's documentation to see if the lighting effect is supported.

```

Parameters:
* props: a collection of light sources

This comment has been minimized.

Copy link
@Pessimistress

Pessimistress Mar 13, 2019

Contributor

Explicitly stated what the keys and values are supposed to be. Can I use any key? Do they have any impact on the behavior?

@@ -97,6 +97,10 @@ Notes:

Options for viewport interactivity, e.g. pan, rotate and zoom with mouse, touch and keyboard. This is a shorthand for defining interaction with the `views` prop if you are using the default view (i.e. a single `MapView`).

#### `effects` (Array)

The array of effects to be rendered

This comment has been minimized.

Copy link
@Pessimistress

Pessimistress Mar 13, 2019

Contributor

Link to the Effect class(es)

specularColor: [255, 255, 255]
});
const INITIAL_VIEW_STATE = {

This comment has been minimized.

Copy link
@Pessimistress

Pessimistress Mar 13, 2019

Contributor

No need to emphasize this. Since you are omitting geojson data in this code sample, you can skip irrelevant deck props too.

This comment has been minimized.

Copy link
@jianhuang01

jianhuang01 Mar 13, 2019

Author Contributor

The reason I keep this view state here is that, I want to show users the coordinate system in point lights is the same as view state

This comment has been minimized.

Copy link
@Pessimistress

Pessimistress Mar 13, 2019

Contributor

Add a comment then?

This comment has been minimized.

Copy link
@jianhuang01

jianhuang01 Mar 13, 2019

Author Contributor

comment is added in point light position line, don't want to duplicate here.

jianhuang01 added some commits Mar 13, 2019

@@ -125,6 +125,10 @@ new Deck({

Default `null`.

#### `effects` (Array)

The array of effects to be rendered, a lighting effect will be added if an empty array is supplied, refer to effect's documentation to see details

This comment has been minimized.

Copy link
@Pessimistress

Pessimistress Mar 13, 2019

Contributor

Break into three sentences.

specularColor: [255, 255, 255]
});
const INITIAL_VIEW_STATE = {

This comment has been minimized.

Copy link
@Pessimistress

Pessimistress Mar 13, 2019

Contributor

Add a comment then?

```

Parameters:
* props(Object): a collection of light sources with user defined keys.

This comment has been minimized.

Copy link
@Pessimistress

Pessimistress Mar 13, 2019

Contributor

Keys can be any arbitrary name and values are instances of Light.

  • list link to each light source class and documentation

@jianhuang01 jianhuang01 merged commit f9bc84f into master Mar 13, 2019

3 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details

@jianhuang01 jianhuang01 deleted the lighting-docs branch Mar 13, 2019

ajduberstein added a commit to ajduberstein/deck.gl that referenced this pull request Apr 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.