Repository navigation
Update docs for getShaders() - #876
Merged
Merged
Conversation
ibgreen
approved these changes
Aug 23, 2017
ibgreen
left a comment
Collaborator
There was a problem hiding this comment.
Excellent, thanks!
Were there no places where this was an issue in the existing layers (including sample-layers)?
| This makes it much easier for others to subclass your layer and make small | ||
| changes to the shaders. | ||
|
|
||
| Note: When overwriting `getShaders()` you pass down any unmodified shader(s) |
Collaborator
There was a problem hiding this comment.
you pass => you should pass ... See code example below.
| vs: super.getShaders().vs, | ||
| fs: fragmentShader | ||
| } | ||
| const shaders = Object.assign({}, super.getShaders(), { |
Collaborator
There was a problem hiding this comment.
Add a comment -
// use object.assign to make sure we don't overwrite existing fields like `vs`, `modules`...
| @@ -59,17 +59,22 @@ export default MultiColorPathLayer extends PathLayer { | |||
|
|
|||
| You can replace the shaders used in a layer by overriding the `getShaders()` | |||
Collaborator
There was a problem hiding this comment.
Could we add any links to luma.gl shader modules docs (or maybe they are still pretty thin?)
Contributor
Author
There was a problem hiding this comment.
luma.gl's shader module documentation talks more about assemberShaders and Model class, not about shader modules in general, probably not a good link.
Contributor
Author
|
Verified sample-layers, most extend Layer. Fixed in few examples. |
howtimeflies0
approved these changes
Aug 24, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #867