Commit graph

1072 commits

Author SHA1 Message Date
Richard Davey
3f4ebf5dd7 Update WebGLRenderer.js 2022-10-06 18:35:04 +01:00
Richard Davey
f0d3588f7b Use batch system to avoid bufferSubData spamming - massively improves performance! 2022-10-05 00:59:04 +01:00
Richard Davey
08ee414ad5 Inline array add to stop branching 2022-10-05 00:58:33 +01:00
Richard Davey
010db3f2a3 Updated jsdocs 2022-10-04 18:27:19 +01:00
Richard Davey
ba8d25909f Update PipelineManager.js 2022-10-04 18:27:11 +01:00
Richard Davey
03f09e2c10 Added setDefaultPipeline method 2022-10-04 18:20:17 +01:00
Richard Davey
3d3b675ae8 Pass over the config values 2022-10-04 18:04:26 +01:00
Richard Davey
64972f8456 Added default pipeline and mobile swap 2022-10-04 18:04:18 +01:00
Richard Davey
20485e1aa2 Added MobilePipeline 2022-10-04 17:08:48 +01:00
Richard Davey
554ef91353 Correct docs 2022-10-04 14:49:26 +01:00
Richard Davey
e774987897 Removed unused code 2022-10-04 14:49:19 +01:00
Richard Davey
1316c09d1c Merge branch 'master' of https://github.com/photonstorm/phaser 2022-10-04 13:17:44 +01:00
Richard Davey
d9a30e6c52 Remove unused shaders 2022-10-04 13:17:33 +01:00
arbassic
58cf547d47 fix: use webgl 1 pattern to always use best precision available 2022-10-04 01:11:10 +02:00
Richard Davey
1a23b31947 Remove swap and rename method 2022-10-03 22:07:07 +01:00
Richard Davey
b52a730f9b Rename function 2022-10-03 22:06:58 +01:00
Richard Davey
416aa053da Swap to using RenderTarget, much cleaner 2022-10-03 21:09:15 +01:00
Richard Davey
eba9254e1a The BitmapMaskPipeline now hands over most control of the framebuffers to the WebGLRenderer. 2022-10-03 18:50:48 +01:00
Richard Davey
b327f39c5e Bitmap Mask updates
* The `WebGLRenderer` has 4 new properties: `maskTargetFramebuffer`, `maskSourceFramebuffer`, `maskTargetTexture` and `maskSourceTexture`. These are the new global locations of the mask framebuffers.
* `WebGLRenderer.createBitmapMask` is a new method that internally creates the Bitmap Mask framebuffers.
* `WebGLRenderer.clearBitmapMask` is a new method that internally clears the existing Bitmap Mask framebuffers, called as part of a resize event.
* `WebGLRenderer.enableBitmapMask` is a new method that starts the process of using the mask target framebuffer for drawing. This is called by the `BitmapMaskPipeline`.
* `WebGLRenderer.drawBitmapMask` is a new method that completes the process of rendering using the mask target framebuffer. This is called by the `BitmapMaskPipeline`.
2022-10-03 18:49:55 +01:00
Richard Davey
dcb1c8a9dd Allowing custom resolution for mask shader 2022-09-29 23:35:06 +01:00
Richard Davey
3abea4286f When rendering a Sprite with a Camera set to roundPixels it will now run Math.floor on the Matrix position, preventing you from noticing 'jitters' as much when Camera following sprites in heavily zoomed Camera systems. 2022-09-29 22:11:02 +01:00
Richard Davey
2e870a0a2c Previously, the Multi Tint methods batchSprite, batchTexture, batchTextureFrame and batchFillRect would all make heavy use of the TransformMatrix.getXRound and getYRound methods, which in turn called getX and getY and applied optional rounding to them. This is all now handled by one single function (setQuad) with no branching, meaning rendering one single sprite has cut down 16 function calls and 48 getters to just 1 function. 2022-09-29 17:17:24 +01:00
Richard Davey
ab04cb6c05 Lots of LightPipeline improvements
* The Light Pipeline no longer creates up to `maxLights` copies of the Light shader on boot. Previously it would then pick which shader to use, based on the number of visible lights in the Scene. Now, the number of lights is passed to the shader and branches accordingly. This means rather than compiling _n_ shaders on boot, it now only ever needs to create one.
* You can now have no lights in a Scene, but the Scene will still be impacted by the ambient light. Previously, you always needed at least 1 light to trigger ambient light (thanks jstnldrs)
* The `Light.frag` shader now uses a new `uLightCount` uniform to know when to stop iterating through the max lights.
* The `LightPipeline.LIGHT_COUNT` constant has been removed as it's not used internally.
* The `LightPipeline` previous created a global level temporary vec2 for calculations. This is now part of the class as the new `tempVec2` property.
2022-09-23 00:42:04 +01:00
Richard Davey
a135271f19 Use new uLightCount uniform 2022-09-23 00:41:47 +01:00
Richard Davey
b789742636 Update Utils.js 2022-09-22 14:55:29 +01:00
Richard Davey
9d43583a63 This shader is just better. More crappy iOS testing needed though. 2022-09-21 23:13:04 +01:00
Richard Davey
023343c789 All events have a type of string. Fix #6136 2022-09-21 22:01:03 +01:00
Richard Davey
a79cb668aa
Merge pull request #6202 from samme/fix/render-texture-snapshot-pixel-alpha
Fix wrong alpha in snapshot pixel
2022-09-05 18:34:03 +01:00
brendo
93eceb7d99 show error code 2022-08-30 07:42:14 +08:00
samme
bbd4840dbc Fix wrong alpha in snapshot pixel 2022-08-26 10:44:06 -07:00
Richard Davey
4c2d3e3cff setTextureZero will now set isTextureClean to false 2022-08-24 13:56:12 +01:00
Richard Davey
9bc8826684 Specify the canvas is for drawing, not reading 2022-08-18 18:01:45 +01:00
Richard Davey
f09ec762ee Removed Graphics Pipeline
The WebGL Graphics Pipeline has been removed. This pipeline wasn't used in v3.55, as all Graphics rendering is handled by the MultiTint pipeline, for better batching support. No Phaser Game Objects use the Graphics pipeline any longer, so to save space it has been removed and is no longer installed by the Pipeline Manager.
2022-07-12 13:39:51 +01:00
Jonah Jeleniewski
e8c8be0385
Let texture scaleMode override the antialias setting under CANVAS 2022-06-11 18:07:29 +10:00
Richard Davey
aa2dda09e2 UtilityPipeline.blitFrame has a new optional boolean parameter flipY which, if set, will invert the source Render Target while drawing it to the destination Render Target. 2022-05-30 18:25:21 +01:00
samme
54d12080eb
Docs: fix the mipmapFilter example code 2022-05-09 09:44:09 -07:00
Richard Davey
ed152b92d5 WebGLSnapshot and CanvasSnapshot will now Math.floor the width/height values to ensure no sub-pixel dimensions, which corrupts the resulting texture. Fix #6099 2022-05-06 14:45:36 +01:00
Richard Davey
59fbcc5ca3 Updated copyright year 2022-02-28 14:29:51 +00:00
Richard Davey
c8d3a20754 Updated Multi Pipeline shader so it no longer smacks Safari's arse. 2022-02-03 23:12:15 +00:00
Richard Davey
a4308cfa3a Skips Canvas drawImage calls if invalid frame sizes given. Fix #5951 2022-02-03 16:44:24 +00:00
Richard Davey
0603c3bf0f
Merge pull request #5948 from jcyuan/ie9fix
Ie9fix
2022-02-03 16:21:29 +00:00
Andy Mikulski
6108414b75
WebGLSnapshot: Support custom rendering contexts 2022-01-26 15:02:59 -07:00
J.C
7da6f4d747 in canvas mode, don't draw stuff with no size, it will throws error, and actually unnecessary. 2021-12-21 17:18:35 +08:00
Richard Davey
0e364321e6 Update BitmapMask-frag.js 2021-11-23 18:24:14 +00:00
Richard Davey
6c459eb3d5 Update Multi-frag.js 2021-11-23 18:19:05 +00:00
Richard Davey
8699e97f94 The BitmapMask shader has been recoded so it now works correctly if you mask a Game Object that has alpha set on it, or in its texture. Previously it would alpha the Game Object against black 2021-11-23 18:18:47 +00:00
Richard Davey
c37da11d36 pma is essential - to hell with Firefox! 2021-11-08 21:51:08 +00:00
Richard Davey
2efa08d3db Testing pma off 2021-11-08 18:49:48 +00:00
Richard Davey
fc1234e55b Added createProgram, setBoolean and the new src properties 2021-11-02 18:05:18 +00:00
Richard Davey
565dfc801a WebGLPipeline.setBoolean is a new method that allows you to set a boolean uniform on a shader. 2021-11-02 18:00:25 +00:00