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.
Motivation
This is just a precursor to finally fixing the annoying “Image Zoom 🐛”.
Have you read the Contributing Guidelines?
Sure, otherwise I would not be here. 😉
Contribution
This PR vectorizes (thus also optimizes a bit) the fragment shader where applicable. No new functionality has been added.
https://github.com/JakeSmarter/mapillary-js/blob/vectorize_shaders/src/api/provider/GraphDataProvider.ts#L41
The
DEFAULT_ENDPOINT
could also be aconst
in the global scope, if that is something you would rather like.Should non‑texture fragments be
https://github.com/JakeSmarter/mapillary-js/blob/main/src/shader/chunk/map_color_fragment.glsl.ts#L11
transparent black or
https://github.com/JakeSmarter/mapillary-js/blob/vectorize_shaders/src/shader/chunk/map_color_fragment.glsl.ts#L9
rather opaque black?
Btw, I am not a huge fan of hard coding shader sources in the application source code and spreading them over multiple foreign programming language source files, although I do understand that there are some advantages to this approach. However, the biggest downside to this are the lack of overview, proper file management, and correct syntax highlighting. Better use
shaderSource()
,attachShader()
,linkProgram()
, and friends. Or, build a single string out of pure shader source files. Just something to think about.Test Plan
No unit test for shaders. Just run it to see if it works for you. This PR is nothing more than a functional equivalent.