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

Allow a non truncated linesofar (overall line distance) for line shader (feature request) #3883

Closed
kaligrafy opened this issue Jan 3, 2017 · 4 comments

Comments

@kaligrafy
Copy link

Would it be possible to access the overall length of a line in the line shader so we can create fading or gradient lines (like getting a value between 0.0 and 1.0 that represents the linesofar in percentage of total)? Also, it would allow a better dasharray rendering when using polygons as input to create lines (right now, the dash line is too short or to long at the location where the stroke start and end).

@kaligrafy
Copy link
Author

Well, I just saw in the line_bucket that you limit the size of linesofar to 15 bits. Could it be possible to add a parameter that would allow more bits for the storing of the line distance so it is not truncated to zero when reaching max distance (like add a float uniform)? I know this would affect performance, but otherwise it would not be possible to use gradients or fades on line, isn't it?

@kaligrafy kaligrafy changed the title Get the length of a line in shader (feature request) Allow a non truncated linesofar (overall line distance) for shaders (feature request) Jan 3, 2017
@kaligrafy kaligrafy changed the title Allow a non truncated linesofar (overall line distance) for shaders (feature request) Allow a non truncated linesofar (overall line distance) for line shader (feature request) Jan 3, 2017
@jfirebaugh
Copy link
Contributor

@kaligrafy I'd rather track this as a request for a specific feature, rather than presupposing specific implementation details like shader parameters. Does mapbox/mapbox-gl-style-spec#349 describe what you're trying to accomplish?

@kaligrafy
Copy link
Author

Yes, as long as the linesofar is provided as a float representing the location on the line between 0.0 (start of the line) and 1.0 (end of the line)

@jfirebaugh
Copy link
Contributor

Ok, let's centralize discussion at mapbox/mapbox-gl-style-spec#349.

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

No branches or pull requests

4 participants