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

transform symbol vertices outside of shaders #4718

Closed
ansis opened this issue May 17, 2017 · 4 comments · Fixed by #4781
Closed

transform symbol vertices outside of shaders #4718

ansis opened this issue May 17, 2017 · 4 comments · Fixed by #4781
Assignees

Comments

@ansis
Copy link
Contributor

ansis commented May 17, 2017

Broader context: #4704

I'm working on transforming symbol vertices in javascript. Each frame the vertices are shifted, offset, projected and added to buffers as gl coordinates. Doing the transform outside of shaders let's us have full access to the line geometry which let's us render better in pitched views.


I'm working on this in the cpu-label-transform branch.

I've hacked in a rough implementation that is mostly working, but it's currently taking ~20ms to run. I'm working on a bunch of relatively low-hanging optimizations that will hopefully cut that down significantly.

@ChrisLoer @kkaefer

@ansis
Copy link
Contributor Author

ansis commented May 19, 2017

Update: it's getting faster ~10ms but not quite there yet. Still some clear optimization opportunities.

@ansis
Copy link
Contributor Author

ansis commented May 30, 2017

Update:

This is getting closer. The cpu vertex transformation is now taking roughly 1-2ms on a large map on my computer.

I ended up moving as much work as possible back to the shader:

  • the final matrix multiply to move from label plane coords to gl coords
  • corner extrusion and rotation
  • all point label rendering (in progress)

I still need to:

  • remove old, dead code
  • clean up new code
  • finish up point label optimization

And then:

  • rebase on master with pitch-scaling work

@mourner
Copy link
Member

mourner commented May 30, 2017

@ansis 1-2ms sounds fantastic!

@ChrisLoer
Copy link
Contributor

@ansis That's awesome! I just checked out the branch and it's running nice and smooth in my browser.

ansis added a commit that referenced this issue Jun 2, 2017
The correct position of a glyph along is now found by doing the work on
the CPU where we have access to the entire line geometry.

For performance, as much work as possible is left to be done in the
shaders. This includes all the work for point horizontal labels.

ref #4718
ansis added a commit that referenced this issue Jun 2, 2017
The correct position of a glyph along is now found by doing the work on
the CPU where we have access to the entire line geometry.

For performance, as much work as possible is left to be done in the
shaders. This includes all the work for point horizontal labels.

ref #4718
ansis added a commit that referenced this issue Jun 2, 2017
The correct position of a glyph along is now found by doing the work on
the CPU where we have access to the entire line geometry.

For performance, as much work as possible is left to be done in the
shaders. This includes all the work for point horizontal labels.

ref #4718
ansis added a commit that referenced this issue Jun 2, 2017
The correct position of a glyph along is now found by doing the work on
the CPU where we have access to the entire line geometry.

For performance, as much work as possible is left to be done in the
shaders. This includes all the work for point horizontal labels.

ref #4718
ansis added a commit that referenced this issue Jun 9, 2017
The correct position of a glyph along is now found by doing the work on
the CPU where we have access to the entire line geometry.

For performance, as much work as possible is left to be done in the
shaders. This includes all the work for point horizontal labels.

ref #4718
ansis added a commit that referenced this issue Jun 12, 2017
The correct position of a glyph along is now found by doing the work on
the CPU where we have access to the entire line geometry.

For performance, as much work as possible is left to be done in the
shaders. This includes all the work for point horizontal labels.

ref #4718
ansis added a commit that referenced this issue Jun 12, 2017
The correct position of a glyph along is now found by doing the work on
the CPU where we have access to the entire line geometry.

For performance, as much work as possible is left to be done in the
shaders. This includes all the work for point horizontal labels.

ref #4718
ansis added a commit that referenced this issue Jun 13, 2017
The correct position of a glyph along is now found by doing the work on
the CPU where we have access to the entire line geometry.

For performance, as much work as possible is left to be done in the
shaders. This includes all the work for point horizontal labels.

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

Successfully merging a pull request may close this issue.

3 participants