Commit graph

432 commits

Author SHA1 Message Date
Richard Davey
5e126b80fa Parent matrix and now optional and it won't draw a line cap unless the first point has been set 2018-09-06 15:07:36 +01:00
Richard Davey
55003641d2 Clamp scissor 2018-08-31 18:19:31 +01:00
Richard Davey
0b95ed0478 Fixed scissors when using a small cam with render texture 2018-08-31 16:25:04 +01:00
Richard Davey
79b4f07530 Fixed mask flush and sped-up the render loop slightly (removed 1 duplicate conditional) 2018-08-31 14:40:12 +01:00
Richard Davey
5270b463d0 Removed visible check as it's no longer needed 2018-08-31 14:39:38 +01:00
Richard Davey
ecae9d0503 The setTintFill method would ignore the alpha value of the Game Object in the shader. The alpha value is now blended with the tint fill, allowing you to properly alpha out tint-filled Game Objects. Fix #3992 2018-08-31 13:27:24 +01:00
Richard Davey
cb0eeb3d63 Added default blank frame for custom pipelines #3978 2018-08-24 23:58:27 +01:00
Richard Davey
1d4b2ed01a Removed un-needed methods and fixed TileSprite and Tilemap Lights. Fix #3949 2018-08-23 17:30:27 +01:00
James Simpson
1ac7c969ea
Don't set gl.clearColor when no clearBeforeRender
Unless I'm missing something, the `gl.clearColor` command is unnecessary when you have `this.config.clearBeforeRender` set to `false`. This simply moves that into the config check to eliminate an unused command in those situations.
2018-08-17 14:03:17 -05:00
Richard Davey
66afe973af Trying mixins 2018-08-08 01:33:55 +01:00
Richard Davey
3a4bfa679b Added experimental Camera to Render Texture 2018-08-07 16:27:21 +01:00
Richard Davey
65d81ec426 Formatting 2018-08-07 16:26:22 +01:00
Richard Davey
f9e498353d Fixed lack of TempMatrix for Graphics generateTexture 2018-08-06 16:19:30 +01:00
Richard Davey
faeed47b5e eslint fixes 2018-08-06 15:32:08 +01:00
Richard Davey
e3f5590fc3 Use var to cut down on bytes 2018-08-06 15:29:36 +01:00
Richard Davey
26cc84522d The CanvasRenderer.BlitImage function has been removed, as has the associated blitImage property from the Canvas Renderer as they're no longer used. 2018-08-06 15:29:27 +01:00
Richard Davey
fbb67ac201 The CanvasRenderer.DrawImage function has been removed, as has the associated drawImage property from the Canvas Renderer as they're no longer used. 2018-08-06 15:24:51 +01:00
Richard Davey
708a857a26 SetTransform is a new Canvas Renderer function that consolidates the process of preparing a Game Object for rendering, without actually rendering it. This is used internally by the Graphics and Bitmap Text classes. 2018-08-03 19:02:43 +01:00
Richard Davey
8ed749bcb1 Removed old scissor code 2018-08-03 18:57:03 +01:00
Richard Davey
22bc6d2a86 The batchTexture method in the Texture Tint Pipeline now supports cropped Game Objects and will adjust the drawn texture frame accordingly. 2018-08-03 18:54:48 +01:00
Richard Davey
ca68904953 The Canvas Renderer has a new batchSprite method that consolidates the process of drawing a texture-based Game Object to the canvas. It processes the alpha, blend mode and matrix calculations in a single function and now is used by nearly all Game Object canvas renderers. 2018-08-03 18:53:50 +01:00
Richard Davey
fc0dc13930 Removed use of currentBlendMode and currentAlpha 2018-08-03 01:53:51 +01:00
Richard Davey
9f44896a3f The Blend Mode is now set directly in all Canvas Renderers without comparing it to what's stored in the Canvas Renderer. This fixes problems where the blend mode would be lost between two different Game Objects because they restored the context, but didn't update the renderer flag. Game Objects in Canvas can now mix and match blend modes across the display list. 2018-08-03 01:29:18 +01:00
Richard Davey
286f36cd1e Added ability for the Canvas Renderer to change context. 2018-08-02 14:57:37 +01:00
Richard Davey
2220faba49 Removed un-used method 2018-08-01 15:20:10 +01:00
Richard Davey
7ebf5766e8 Added docs for blankTexture and setBlankTexture. 2018-08-01 13:23:03 +01:00
Richard Davey
73524df816 The Game boot event flow has changed slightly. The Game will now listen for a texturesready event, which is dispatched by the Texture Manager when the default textures have finished processing. Upon receiving this, the Game will emit the ready event, which all the other systems listen for and respond to. The difference is that the Renderer uses the texturesready event to ensure that it is the first thing to be activated, before any other system. 2018-08-01 13:18:28 +01:00
Richard Davey
a4db967b19 Added 4 temp matrices to the Canvas renderer. 2018-07-31 23:23:04 +01:00
Richard Davey
be379fd3a1 Added batchTextureFrame method 2018-07-31 17:10:02 +01:00
Richard Davey
a3fc263360 Binding a framebuffer sets the viewport size 2018-07-31 17:09:47 +01:00
Richard Davey
6749417ef3 lint fix 2018-07-27 11:19:19 +01:00
Richard Davey
9331c15c48 Updated to use tint object. 2018-07-27 02:14:08 +01:00
Richard Davey
4481795d32 Swapped to using getX / getY 2018-07-27 00:53:00 +01:00
Richard Davey
6877582531 Removed un-used pipeline and shaders 2018-07-26 23:43:49 +01:00
Richard Davey
4bdecf488b jsdocs tweaks 2018-07-26 23:41:52 +01:00
Richard Davey
a09c2a4958 Now uses customViewports counter to avoid scissor setting and skips box check 2018-07-26 23:05:25 +01:00
Richard Davey
1777e16227 Sorting out the scissor stack 2018-07-26 17:50:07 +01:00
Richard Davey
d093f35e5c Merged all of the required FTP methods into TTP. 2018-07-26 16:34:04 +01:00
Richard Davey
e0c0db5f8e Final bit of tidying up before merging this with the TTP. 2018-07-26 16:33:43 +01:00
Richard Davey
90219d46b3 Removed all references to the FlatTintPipeline. 2018-07-26 16:33:29 +01:00
Richard Davey
947d301f42 Removed the unit batch from TTP and put it into FDLP 2018-07-26 15:31:44 +01:00
Richard Davey
bda9159cb0 Textures now use the frame UV values. 2018-07-26 15:05:10 +01:00
Richard Davey
d3e07b519a Added setBlankTexture method 2018-07-26 15:04:46 +01:00
Richard Davey
7acbbcf58a Fixed linejoin, added arc and triangle, tidying up code 2018-07-26 13:49:05 +01:00
Richard Davey
39a6622623 Working on joints 2018-07-26 09:58:33 +01:00
Richard Davey
3a2fcd0951 Updated path drawing, sorting out line-cap differences with Canvas 2018-07-25 17:04:44 +01:00
Richard Davey
9d11b93b05 Updated shader 2018-07-25 13:06:22 +01:00
Richard Davey
4c25d12b44 Recoding the FTP. Rects and Tris working again. 2018-07-25 01:27:03 +01:00
Richard Davey
0516fd47f7 The Flat Tint Pipeline is now using the same shader as the Texture Tint
Time to make sure no texture swaps happen and we can finally have Graphics mixed with Sprites in the display list with no swapping cost (and soon, no flush cost either when we unify the pipelines)
2018-07-24 17:07:26 +01:00
Richard Davey
ac108db9cc Moving towards tidying up the FTP 2018-07-24 16:40:29 +01:00
Richard Davey
521138e9d8 setBlendMode now returns a boolean 2018-07-23 01:39:32 +01:00
Richard Davey
ec5bd1912e GameObject.willRender now takes a Camera as its only argument and uses it within the check. This has allowed me to remove 23 duplicate checks spread across the various Game Objects, all of which did the same thing, saving both KB and CPU time as the flags were being checked twice in most cases. 2018-07-19 13:19:02 +01:00
Richard Davey
b6a1033dbd Fixed Camera FX for scaled camera sizes 2018-07-18 15:03:06 +01:00
Richard Davey
0db16889e6 Use new Camera viewport values 2018-07-18 14:32:06 +01:00
Richard Davey
1c473afa84 Cameras draw their backgrounds correctly at higher resolutions 2018-07-17 23:26:30 +01:00
Richard Davey
42c3fc5f6b Better normal map handling 2018-07-13 11:14:22 +01:00
Richard Davey
4843d7eefe Pipelines have a boot handler now. 2018-07-13 11:13:46 +01:00
Richard Davey
2924874236 Added docs 2018-07-12 01:13:47 +01:00
Richard Davey
072cc0e21b Added dirty Camera support and updated internal properties to set the flag 2018-07-12 01:13:34 +01:00
Richard Davey
a0bf5b6ad2 Removed all the batch functions and consolidated into a single function and callback 2018-07-11 16:55:18 +01:00
Richard Davey
efb5eb09c5 Starting refactor 2018-07-11 16:24:58 +01:00
Richard Davey
05985417b3 Allow config setting values. Gets custom pipelines working again. 2018-07-11 16:24:45 +01:00
Richard Davey
5a5bea1ce5 Allow GO to be passed to onBind 2018-07-11 16:24:20 +01:00
Richard Davey
82b15c8695 Removed drawEmitterManager and moved to emitter render function 2018-07-11 14:40:36 +01:00
Richard Davey
853281fe56 Double flusher 2018-07-11 13:22:07 +01:00
Richard Davey
373d01c602 Fixed emitter batch. Now to optimize it. 2018-07-11 13:20:02 +01:00
Richard Davey
e2efa469ae Removed drawTexture and added drawTextureFrame - fixed Render Texture flip Y issue 2018-07-11 12:34:53 +01:00
Richard Davey
5b3a5e115b Started consolidating drawTexture method 2018-07-10 17:18:00 +01:00
Richard Davey
340c53875c Added new temp matrix, fixed typo, removed old function 2018-07-10 16:32:44 +01:00
Richard Davey
5128eecbeb Cached the drawing buffer height 2018-07-10 16:32:28 +01:00
Richard Davey
434c8d1413 Fixed issue with sprite matrix and camera scaling 2018-07-10 13:59:49 +01:00
Richard Davey
85a32d54be Typo 2018-07-09 17:06:27 +01:00
Richard Davey
5c554f3f69 Started moving dynamic bitmap text renderer to its own function 2018-07-07 12:34:24 +01:00
Richard Davey
dd0490dd57 Removed batchBitmapText, tidied up and moved to its own renderer 2018-07-07 12:22:45 +01:00
Richard Davey
8b13631107 Removed batchMesh and moved to the Mesh WebGL Renderer. Another one bites the dust. 2018-07-06 19:35:46 +01:00
Richard Davey
c1bc928a73 Removed un-used vars 2018-07-06 17:29:49 +01:00
Richard Davey
a6ff0d54bb Removed angle calculations from renderer as we only need do it when the arc is first defined 2018-07-06 17:16:09 +01:00
Richard Davey
fdd4a8f8f3 Tidied up DrawImage to re-use vars and cut down code 2018-07-06 15:55:20 +01:00
Richard Davey
e620f3e308 Updated to use matrix and support crop 2018-07-06 15:34:25 +01:00
Richard Davey
325fb4681e Tidying up 2018-07-05 23:55:00 +01:00
Richard Davey
5063fe30e5 Fixed cropping when texture frame is flipped 2018-07-05 23:01:26 +01:00
Richard Davey
341ecf42cd Testing flip + atlas frame + trim cropping 2018-07-04 17:01:45 +01:00
Richard Davey
9bd8fb34a4 Changed canvasData to remove duplicate properties. 2018-07-04 17:01:29 +01:00
Richard Davey
43fc988034 Moved crop UV handler to the Frame method. Cleaner and easier. 2018-07-04 15:18:08 +01:00
Richard Davey
ee8c1b403a Fixed cropping with flipped images 2018-07-04 14:50:26 +01:00
Richard Davey
d44c54e5ed batchSprite supports cropping (flipXY todo) 2018-07-03 16:48:14 +01:00
Richard Davey
d328f14be0 Fixed vertex calculation 2018-07-03 12:38:45 +01:00
Richard Davey
187328ea1a UVs are passed directly now 2018-07-03 00:14:23 +01:00
Richard Davey
265852fc75 Removed test code 2018-07-02 17:09:21 +01:00
Richard Davey
35686657ce Tidied up the batchVertices method and removed old stuff 2018-07-02 17:06:49 +01:00
Richard Davey
c1020c6dbb Refactoring TTP to remove so much redundant stuff 2018-07-02 16:44:24 +01:00
Richard Davey
fe61cfe2d1 You can now set the WebGL batch size in the Game Config via the property batchSize. The default is 2000 before the batch will flush, which is a happy average between desktop and mobile. If targeting desktop specifically, you may wish to increase this value to reduce draw calls. 2018-07-02 12:33:46 +01:00
Richard Davey
1941d8a494 Removed drawStaticTilemapLayer method and updated layer vertex code 2018-07-02 12:07:39 +01:00
Richard Davey
fdead2af16 Added the tint effect attribute and merged with all the various batches 2018-06-30 11:33:52 +01:00
Richard Davey
11ef2c824b Updated shader to support tint effect attribute 2018-06-30 11:33:28 +01:00
Richard Davey
e22b1a7b9c Removed stubs from pipelines 2018-06-29 12:33:44 +01:00
Richard Davey
39c3866179 lint fix 2018-06-28 13:07:59 +01:00
Richard Davey
217779604c Added tileScaleX and tileScaleY support for Tile Sprites 2018-06-28 12:59:27 +01:00
Richard Davey
8c312090da Solidified use of pixelArt mode 2018-06-27 15:27:16 +01:00
Richard Davey
7a23378015 Unified use of roundPixels, antialias and pixelArt modes 2018-06-27 15:15:00 +01:00