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

Implement font rendering for wgpu backend #18

Merged
merged 1 commit into from
Apr 28, 2019

Conversation

hecrj
Copy link
Owner

@hecrj hecrj commented Apr 28, 2019

Fixes #5.

This was pretty straightforward to integrate. I have:

  • Added wgpu_glyph as a dependency.
  • Implemented gpu::Font for the wgpu_backend. The implementation is very similar to the gfx backend.

The hardest part was writing wgpu_glyph, which still needs some improvements.

Currently, there are differences between gfx and wgpu font rendering. I suspect it is related to the way we deal (or do not deal) with gamma correction. I will open a new issue to further investigate this.

@hecrj hecrj added the feature New feature or request label Apr 28, 2019
@hecrj hecrj self-assigned this Apr 28, 2019
@@ -128,6 +128,8 @@ impl Gpu {
font: &mut Font,
target: &TargetView,
depth: &DepthView,
_target_width: u32,
_target_height: u32,
Copy link
Owner Author

@hecrj hecrj Apr 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think glyph_brush can be improved to be target size agnostic. I will try to make a PR to glyph_brush with the idea, but there will be breaking changes.

If all goes well, it should allow us to support font rendering on any Target, with custom Transformation support.

Copy link
Owner Author

@hecrj hecrj Apr 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related issue: alexheretic/glyph-brush#63.

@hecrj hecrj merged commit d7053c0 into master Apr 28, 2019
@hecrj hecrj deleted the feature/wgpu-font-rendering branch April 28, 2019 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Font rendering for the wgpu graphics backend
1 participant