454 Commits

Author SHA1 Message Date
Christopher Willis-Ford
3ff532dbee Quick fix for line drawing gaps
This fixes 238747426 and mostly fixes 197728370 without breaking 225569460
2018-08-10 18:30:38 -07:00
Michael "Z" Goddard
4c8bc5d806
Framebuffer PenSkin (#319)
* draw pen skin lines and stamps to a framebuffer

* skip reading pixels and draw stamp to framebuffer

* update silhouette with readPixels

* draw pen canvas to buffer when its dirty

Composite lines and stamps on browser preferred side (cpu/gpu) until
the export texture is needed. Then blend the canvas with the current
buffer contents.

Updating this way invalidates useProgram optimization and the renderer
currently does not have a way to know this.

* draw lines on framebuffer through fragment shader

* optimize draw regions and pen skin matrix creation

* control draw regions

* mobile gpus need high precision floats for line drawing

* optimize cpu pen line math

* sampled pen line caps

* sampleless pen skin lines, lint, document pen skin buffer ops

* add PenSkin._canvasDirty to constructor

* remove DRAW_MODE_line

* comment PenSkin reused memory, use memory in drawRectangle

* turn draw region id's into optional method handlers

A region ID object may have an enter and exit method on it that are
used by default when entering and exiting that region.

* remove old DRAW_MODE_line precision setting

* standardize vert lines on 4 spaces

* fixup! turn draw region id's into optional method handlers

* do not draw when updating pen skin silhouette

* do not premultiply stamp colors by alpha

* fixup! do not draw when updating pen skin silhouette

* do not premultiply line color

* add a small rim around the line for aliasing

* variable pen line alias amount

* reverse offset pen line on y axis by relative alias amount

Reverse the offset to keep small line overlap to a minimum.

* fixup! reverse offset pen line on y axis by relative alias amount

* medium precision gpu floats
2018-08-08 14:30:51 -04:00
Mx Corey Frang
c54a928f0a
Touching color implementation (#312)
* Touching color draft implementation

* New constant for CPU/GPU render split determined, removing query param

* Small fix for pick tests
2018-08-08 14:20:35 -04:00
Michael "Z" Goddard
d88b2b4df4 offset pen lines of width 1 and 3 (#314) 2018-08-08 14:05:30 -04:00
Michael "Z" Goddard
c08b853519 add uniformName to ShaderManager EFFECT_INFO entries (#328) 2018-08-08 14:04:37 -04:00
Mx Corey Frang
6863613d20
Optimizing isTouching while creating a drawableTouches for sensing mouse pointer (#325)
* Allow 'isTouching' and 'pick' to still work on invisible drawables.

* Always ignore visibility for isTouching on drawable

* Filter invisble drawbles in isTouchingDrawable per rules of collision

* polish up some docs/get logic 👍

* leftover line from deleted comment

* revert to ghosted pick behavior

* Add clientSpaceToScratchBounds method

* fix lint

* add some pick tests
2018-08-07 10:56:28 -04:00
Karishma Chadha
11671ee885 Add API for getting the drawable order of a given drawable. 2018-07-24 11:05:38 -04:00
Michael "Z" Goddard
9b869e0da7 Depend on script dependencies for downstream webpack
Downstream webpack will need any dependencies src/ depends on so it can
successfully build. Also if multiple packages being built into a larger
script share a common dependency version range, they can share the
dependency instead of duplicating it. This will save built file size,
execution time, and memory.
2018-05-31 16:49:21 -04:00
Paul Kaplan
d7e39a35d7
Merge pull request #296 from paulkaplan/fix-escaping
Remove duplicate xml escaping
2018-05-29 16:18:31 -04:00
Paul Kaplan
44c30d76ad Add snapshot test for bubble svg strings 2018-05-29 15:28:16 -04:00
Paul Kaplan
d7b26ea1be Remove duplicate xml escaping
We used to write the user string directly into the svg string, but now we are setting the `.textContent` of an actual dom node, which does the escaping for us.
2018-05-29 14:25:35 -04:00
kchadha
d8f82b21ec
Merge branch 'develop' into layer-ordering 2018-05-25 09:23:02 -04:00
Paul Kaplan
5009692426 Add an explicit width and height to fix bubbles on retina screens 2018-05-22 09:35:41 -04:00
DD
8abffc7f0b Add viewbox to speech bubble svgs 2018-05-21 14:42:32 -04:00
Karishma Chadha
5205f9cb87 Fix up comments. 2018-05-21 09:47:57 -04:00
Karishma Chadha
f9e2fe5c80 update playground to accommodate new apis. 2018-05-20 22:11:29 -04:00
Karishma Chadha
ce4296be82 Make layer group required and get rid of explicitly ordered layer groups. 2018-05-20 22:07:38 -04:00
Karishma Chadha
2dac278f90 Fix lint errors. 2018-05-20 19:40:21 -04:00
Karishma Chadha
39ce51c6f0 Store offsets for each layer group and use full draw list for updates. 2018-05-20 18:56:39 -04:00
DD
71ecef29a2 Merge branch 'develop' into removeRenderQuirks 2018-05-16 15:16:11 -04:00
DD
528ae873d7 Remove speech bubbles' reliance on svg quirks mode's _transformText 2018-05-16 15:00:04 -04:00
Karishma Chadha
b7ac54293d @type tag does not permit descriptions. 2018-05-16 11:17:57 -04:00
Karishma Chadha
2a4f6f9f02 Add layer groups to control explicit and implicit layer ordering. 2018-05-15 22:06:27 -04:00
Paul Kaplan
d35a3205bd Actually fix the font in the say bubbles 2018-05-11 14:41:39 -04:00
Paul Kaplan
e8ba24a43e Prevent errors when testing empty silhouettes 2018-05-11 14:05:16 -04:00
Paul Kaplan
905a346161 Subvert the font converter to maintain the font in text bubbles 2018-05-11 13:23:13 -04:00
DD
3be6a4d4a8 Fix jsdoc 2018-05-04 10:22:47 -04:00
Paul Kaplan
c85a13958a
Merge pull request #267 from paulkaplan/sudo-fix-color-bug
Fix color inversion bug on mobile
2018-05-02 07:43:22 -04:00
Paul Kaplan
0b849296c0
Merge pull request #268 from paulkaplan/fix-blurry-fullscreen
Scale the drawable scale by the ratio of pixel size to native size.
2018-05-02 07:43:07 -04:00
Paul Kaplan
085931cb4f Scale the drawable scale by the ratio of pixel size to native size.
This makes the vector sprites not blurry in fullscreen mode
2018-04-30 16:33:35 -04:00
Paul Kaplan
bd8ca26bb7 Fix color inversion bug on mobile 2018-04-30 15:54:13 -04:00
Mx Corey Frang
2b8371e5af
Rewrite isTouchingDrawables on CPU (#263)
* avoid gl.readPixels at all costs
2018-04-27 16:19:25 -04:00
DD
26f2039f39 We decided that it should not be the renderers responsibility to know a detail about how the paint editor works, and have the bitmap resolution passed in instead 2018-04-26 17:58:48 -04:00
DD Liu
d9c5b595a2
Merge pull request #264 from fsih/updateBitmap
Add updateBitmapSkin to renderer
2018-04-25 14:11:57 -04:00
DD
a49c455d9b Update bitmap 2018-04-24 17:01:59 -04:00
Karishma Chadha
ac1f5564a3 Bitmap (+ double resolution) support. 2018-04-22 21:30:28 -04:00
Karishma Chadha
1f574d6ee3 Provide an api to get the calulated rotation center from the rendered costume 2018-04-20 00:01:41 -04:00
Paul Kaplan
bbcf6f73d3 Add method for getting the size of a skin by skin id.
Renamed the `getSkinSize` method to `getCurrentSkinSize`, since it was
using the drawables current skin. Added a new `getSkinSize` method that
works by skin id.
2018-04-10 10:00:54 -04:00
Paul Kaplan
e02cc5ae03
Merge pull request #248 from paulkaplan/fix-bubble-bounds
Add "get bounds for bubble" method.
2018-03-23 14:35:52 -04:00
Paul Kaplan
0b731b92a6 Add "get bounds for bubble" method.
Note there was an inconsequential coordinate flip in the original
transformation code, which was fixed in order for the sliced bounds to
work. The change is at line 388
2018-03-23 10:58:21 -04:00
Chris Willis-Ford
57d834c42e
Merge pull request #235 from mzgoddard/calc-transform-cache
Drawable _calculateTransform cache and inline work
2018-01-24 15:41:31 -08:00
Chris Willis-Ford
f8c781c163
Merge pull request #227 from cwillisf/use-browser-field
Update packaging to use UMD and the browser field
2018-01-24 15:21:16 -08:00
Michael "Z" Goddard
b59b5a3075
Put Drawable skin scale updating behind dirty flag
- Clean out "showing your work" in calculate transform
- Add comments on inline math blocks from twgl
2018-01-23 14:15:59 -05:00
Michael "Z" Goddard
46bc30e4ee
Inline most calculateTransform math 2018-01-23 14:14:38 -05:00
Michael "Z" Goddard
40ab1bd59d
Cache drawable's rotation matrix and rotation center vector
Building a rotation matrix needs to call trigonometry functions. Cache the
resulting matrix to save future time on non-rotation motion.
2018-01-23 14:14:01 -05:00
DD
d46cc4fec7 Merge branch 'develop' into pull231 2018-01-19 17:33:17 -05:00
DD
008abed073 correct case 2018-01-19 17:19:58 -05:00
Paul Kaplan
8a04fcd541 Cache image element in the SVG renderer. 2018-01-17 09:46:07 -05:00
Christopher Willis-Ford
89b5ed32d0 First pass at re-rasterizing SVGs when scaled 2018-01-17 01:05:44 -05:00
Christopher Willis-Ford
bc423cef46 Use require, not import, for SVG renderer 2018-01-12 13:12:55 -08:00