Repository navigation
Conversation
Basic support to allow circle in v8 styles. Both the circle_bucket and draw_circle need to be implemented. This stub will not draw circles, but is sufficient to keep from failing when it encounters a circle in a stylesheet.
|
I'm grabbing this branch and working on it today/tomorrow |
|
CIRCLES! This branch is ready for review: it draws circles of various colors, with blurring. I assume we'll merge this into the v8 branch if it passes muster? |
There was a problem hiding this comment.
If you switch from a rotated square to an axis aligned square with vertices ((-1, -1), (1, -1), (1, 1), (-1, 1)) you should be able to remove the sqrt(2.0) here
|
We can reduce the size of circle vertex buffers by half if we pack the position and extrude together into 4 bytes. If we switch to a square, there will be only two possible extrude component values: -1 and 1. Each component of the extrude only needs a single byte. Each position component has 16 bytes but doesn't need all of them. The x position and x extrude could be combined into a single short with something like this: They would need to be unpacked in the vertex shader. We do something similar for lines: buffer, vertex shader. |
Remaining issue
|
|
👀 |
|
The circle needs to be antialiased. Something needs to be added here so that 1px is always blurred. Also, what are the units for |
There was a problem hiding this comment.
Most glsl operations can work with vectors, so this can be written as v_extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);
Done
It's relative to the radius of the circle... blur: 1 is "fully blurred" afaik, where the gradient from center to outside is linear |
|
@ansis @jfirebaugh - I've added anti-aliasing and expanded the documentation of the blur parameter in the v8 style spec. Anything else remaining? |
|
|
I think we should not pick one: relative blur makes sense for circles and their use cases, and line-blur as pixels makes sense for lines. Let's keep this as-is. |
|
Yes! looks good |
This is a manual redo of #1241 on top of the v8 branch.
|
Merged in 59c7af4 |
|
\o/ |
1 similar comment
|
\o/ |
This is a manual redo of #1241 on top of the v8 branch.
This is a manual redo of #1241 on top of the v8 branch.
Basic support to allow circle in v8 styles. Both the circle_bucket and
draw_circle need to be implemented.
This stub will not draw circles, but is sufficient to keep from failing
when it encounters a circle in a stylesheet.
The maximum size of a circle appears to be 64 https://developer.apple.com/opengl/capabilities/
With that limitation, we'll need to use triangles