Commit graph

1217 commits

Author SHA1 Message Date
Richard Davey
f434449dd8
The PreFXPipeline.batchQuad method will now apply Math.round to the target bounds center point. This prevents sub-pixel values during the copyTextSubImage2D call, preventing sprites with pre-fx from appearing mis-aligned during camera pans. Fix #6879 2024-08-06 23:27:34 +01:00
Richard Davey
c81c6cecc8 Remove the requirement for autoResize to be set, so anyone can resize a RenderTarget 2024-08-06 18:58:12 +01:00
zekechan
4332448e9f Moved errors description above @ignore tag 2024-07-17 23:32:12 +08:00
zekechan
3658cd145f Updated default location property from literal -1 to type number 2024-07-17 23:31:48 +08:00
Richard Davey
d12b51cb48
The Multi Pipeline batchSprite and batchTexture methods will now apply Math.floor to the sprite matrix calculations if camera round pixels is enabled. 2024-07-16 22:59:22 +01:00
Richard Davey
77f209bbe5
Removed the uRoundPixels shader uniform and from the pipelines. Pass camera.roundPixels to setQuad. 2024-07-16 21:24:16 +01:00
Richard Davey
77bbab31f1 The RenderTarget will now automatically listen for the Renderer resize event if autoResize is true. This fixes an issue with Bitmap Masks where they wouldn't resize if the renderer resized. Fix #6769 2024-07-15 18:34:22 +01:00
Zeke Chan
5e7a8aeb01 Update RenderTarget.js 2024-07-05 14:31:06 +08:00
Zeke Chan
49c32ba5c5 Added clear area functionality 2024-07-04 14:56:06 +08:00
Zeke Chan
7724dd0076 Update WebGLRenderer.js 2024-06-13 11:23:19 +08:00
Zeke Chan
43ce515fcb Update WebGLRenderer.js 2024-06-11 15:25:53 +08:00
Richard Davey
4a82a8bc9b Tidied up documentation and small code tweaks 2024-06-10 17:22:54 +01:00
Zeke Chan
48cd2fc2e0 Update WebGLRenderer.js 2024-06-11 00:05:08 +08:00
Zeke Chan
6014b2d775 Update WebGLRenderer.js
Added `setContextHandlers` method
2024-06-10 23:35:27 +08:00
Zeke Chan
3212f6ff33 Reapply "Update WebGLRenderer.js"
This reverts commit ead539a664.
2024-06-10 14:52:57 +08:00
Zeke Chan
ead539a664 Revert "Update WebGLRenderer.js"
This reverts commit 6489106aa8.
2024-06-10 14:50:14 +08:00
Zeke Chan
6489106aa8 Update WebGLRenderer.js
Added `dispatchContextLost`, `dispatchContextRestored` methods
2024-06-10 14:49:38 +08:00
Richard Davey
946e82b058 Removed .js from require paths (not needed) 2024-05-15 15:02:31 +01:00
Richard Davey
5d1d379991 Updated version to 3.85.0 2024-05-15 15:02:04 +01:00
Ben Richards
b1806fd721 Remove unsynced flipY from Shader and DynamicTexture textures.
This might be causing some issues with context restore,
and seems entirely unnecessary.
2024-02-27 17:29:49 +13:00
Ben Richards
37ba3510f2 Fix RenderTexture crashing in the presence of a light.
More generally, anything with a default/no normal map should be fixed.
2024-02-26 17:45:52 +13:00
Ben Richards
7eede9d236 Standardise texture update in Shader.initSampler2D. 2024-02-26 16:19:24 +13:00
Ben Richards
cab4bab15e Eliminate duplicate code in WebGL video handling.
This involves a new method, `videoToTexture`.
2024-02-23 19:16:18 +13:00
Ben Richards
9a5b51dd27 Eliminate duplicate code in WebGL texture creation/update.
This should make the code lighter and more maintainable.
`UNPACK_FLIP_Y_WEBGL` is now always set, where previously it was allowed
to just remain default (false); this is necessary for the new code path.
`Uint8Array` sources are now allowed to generate MIPMaps.
`WebGLTextureWrapper.update` now checks the type of `pixels`, although
it should only ever be the final case.
2024-02-23 18:43:27 +13:00
Ben Richards
42039a144e Fix failure to restore compressed textures after WebGL context loss. 2024-02-23 17:55:03 +13:00
Ben Richards
3cd756dbe9 Fix new WebGLTextures remaining bound after creation.
This caused an error when calling `Shader.setRenderToTexture()`
after the game started running.
The leftover texture caused a temporary cyclic reference with the new
Framebuffer. The actual rendering pipeline was not affected.
2024-02-22 19:01:03 +13:00
Ben Richards
198598882e Document non-optional texture update flags correctly. 2024-02-22 09:56:17 +13:00
Ben Richards
a0aa09ff31 Fix WebGL errors when updating video textures. 2024-02-22 09:18:12 +13:00
Richard Davey
c445303ffb Revert define changes as they don't work 2024-02-21 13:23:52 +00:00
Richard Davey
7aaa976a4e Updated webpack config DefinePlugin use and corresponding defs to allow those crazy souls who import source directly on node to have a better life #6644 2024-02-21 12:57:48 +00:00
Ben Richards
13d6defb33 Fix rare text sizes failing to render.
If initialized at a power-of-two resolution, then resized to a
non-power-of-two resolution, some extra parameters must be updated.
2024-02-21 11:48:59 +13:00
Ben Richards
a74f99563b Fix spritesheet from atlas from compressed texture. 2024-02-20 21:45:06 +13:00
Ben Richards
93b4b083f1 Fix setting unnecessarily high texture filters. 2024-02-20 13:10:08 +13:00
Ben Richards
a2178c8466 Fix MIPMaps being disabled for compressed textures. 2024-02-20 13:02:19 +13:00
Richard Davey
1f8276ac76 Updated copyright year, company and author 2024-02-19 17:12:24 +00:00
Richard Davey
21a10b736a
Merge pull request #6728 from moufmouf/fix-postfxpipeline
Fixing the Postfix pipeline without introducing a skip frame
2024-02-19 15:30:34 +00:00
Richard Davey
56213a5f7e Update WebGLRenderer.js 2024-02-19 15:28:21 +00:00
Richard Davey
de0a22964e WebGLPipeline.resizeUniform is a new property that is defined in the WebGLPipelineConfig. This is a string that defines a uResolution property, or similar, within the pipeline shader. If the WebGL Renderer resizes, this uniform will now be updated automatically as part of the pipeline resize method. It has been added to both the Multi and Mobile pipelines as default. This fixes issues where the pipelines were rendering with old resolution values, causing graphical glitches in mostly pixel-art games. Fix #6674 2024-02-19 15:28:18 +00:00
Richard Davey
82b1a3e2aa Added missing copyright block 2024-02-19 15:01:56 +00:00
Ben Richards
89543c9880 Change S3TCRGB to S3TCSRGB. 2024-02-17 20:59:00 +13:00
Ben Richards
878d3d2211 Fix support for BPTC and RGTC texture compression.
They use different WebGL extension name formats.
2024-02-13 17:38:19 +13:00
Ben Richards
2e8a8f8081 Add default normal map texture __NORMAL.
Remove `LightPipeline.defaultNormalMap`, as this universal texture is
now available to use.
2024-02-09 15:51:53 +13:00
Ben Richards
23a672bc48 Improve resize handling.
Although the `resize` function does make GL calls,
they will have no effect during context loss.
2024-02-09 12:28:20 +13:00
Ben Richards
6d56791568 Fix incorrect type on WebGLAttribLocationWrapper.wegGLAttribLocation.
A uniform uses a `WebGLUniformLocation`, but an attrib uses a `GLint`.
2024-02-09 11:06:47 +13:00
Ben Richards
4353a1e175 Improve safety around context loss.
Clarify notes on drawing dynamic textures during context loss.
Allow `Shader` to initialize and operate during context loss.
Improve resize handling on context loss and recovery.
2024-02-08 18:53:10 +13:00
Ben Richards
7ed40fdf7d Allow WebGL wrapper operations during context loss. 2024-02-05 16:40:16 +13:00
Ben Richards
a4e96855fc Correct documentation of LightPipeline.currentNormalMap. 2024-02-05 14:30:24 +13:00
David Négrier
e5454a1203 Fixing the Postfix pipeline without introducing a skip frame
Due to #6681, we introduced a skip frame to wait for the PostFX pipeline to be correctly booted.
While this fixed the display issue, it introduced a "skip" frame.
The pipeline would only be visible one frame after being introduced.

The root issue is a binding issue on currentRenderTarget.

Here, we fix the root issue and remove the skip frame.
2024-02-02 16:05:08 +01:00
Richard Davey
604c34c13b Stop tsgen from crashing! 2024-02-02 13:56:24 +00:00
Richard Davey
e00d12195d Fixed incorrect jsdocs 2024-02-02 13:03:38 +00:00