This repository was archived by the owner on Mar 23, 2019. It is now read-only.
Repository navigation
Extrusion shaders - #25
Merged
Merged
Conversation
5 of 8 tasks
lucaswoj
reviewed
Sep 20, 2016
| fragmentSource: fs.readFileSync(path.join(__dirname, 'src/extrusionpattern.fragment.glsl'), 'utf8'), | ||
| vertexSource: fs.readFileSync(path.join(__dirname, 'src/extrusionpattern.vertex.glsl'), 'utf8') | ||
| }, | ||
| extrusiontexture: { |
There was a problem hiding this comment.
It took me a few moments to understand what extrusiontexture is. A name that captures the second-pass-ness of this shader would be ideal. I'll sleep on it.
| void main() { | ||
| #ifdef MAPBOX_GL_JS | ||
| #pragma mapbox: initialize lowp float minH | ||
| #pragma mapbox: initialize lowp float maxH |
| void main() { | ||
| #ifdef MAPBOX_GL_JS | ||
| #pragma mapbox: initialize lowp float minH | ||
| #pragma mapbox: initialize lowp float maxH |
There was a problem hiding this comment.
Our naming convention for identifiers in shaders is lower_underscore_case
lucaswoj
reviewed
Sep 20, 2016
| v_color.r += clamp(color.r * directional * u_lightcolor.r, mix(0.0, 0.3, 1.0 - u_lightcolor.r), 1.0); | ||
| v_color.g += clamp(color.g * directional * u_lightcolor.g, mix(0.0, 0.3, 1.0 - u_lightcolor.g), 1.0); | ||
| v_color.b += clamp(color.b * directional * u_lightcolor.b, mix(0.0, 0.3, 1.0 - u_lightcolor.b), 1.0); | ||
| } |
There was a problem hiding this comment.
I take it from the // TODOs and commented-out code that this file is still somewhat a WIP 😄
|
|
||
| // the following offset calculation is duplicated from the regular pattern shader: | ||
| vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a); | ||
| vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b); |
There was a problem hiding this comment.
We can factor this shared out into util.glsl
…e minH/maxH attributes
…ue, updated starting directional, updated adjusted directional to account for update to starting directional, simplified logic for gradient
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Companion PR to mapbox/mapbox-gl-js#3223.
Adds
cc @nickidlugash @ansis @lucaswoj @jfirebaugh