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

Vectorize shaders #624

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

JakeSmarter
Copy link

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 a const 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.

…ral to `private static readonly` object property for readability

chore(GraphDataProvider): Drop trailing `,`
@facebook-github-bot
Copy link

Hi @JakeSmarter!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants