Commit graph

14487 commits

Author SHA1 Message Date
Richard Davey
d7cf9da819 Added location cache 2020-07-16 03:13:10 +01:00
Richard Davey
5059045c76 Cache attribute location
* `WebGLPipeline.boot` will now check all of the attributes and store the pointer location within the attribute entry.
* `WebGLPipeline.bind` no longer looks-up and enables every attribute, every frame. Instead it uses the cached pointer location stored in the attribute entry, cutting down on redundant WebGL operations.
2020-07-16 03:12:53 +01:00
Richard Davey
98d647848f Update CHANGELOG.md 2020-07-16 02:15:57 +01:00
Richard Davey
4ab9604102 Lots of updates to this pipeline
* The `ForwardDiffuseLightPipeline.defaultNormalMap` property has been removed as it's no longer required.
* The `ForwardDiffuseLightPipeline.boot` method has been removed as it's no longer required.
* The `ForwardDiffuseLightPipeline.onBind` method has been removed as it's no longer required.
* The `ForwardDiffuseLightPipeline.setNormalMap` method has been removed as it's no longer required.
* The `ForwardDiffuseLightPipeline.bind` is a new method that handles setting-up the shader uniforms.
* The `ForwardDiffuseLightPipeline.batchTexture` method has been rewritten to use the Texture Tint Pipeline function instead.
* The `ForwardDiffuseLightPipeline.batchSprite` method has been rewritten to use the Texture Tint Pipeline function instead.
2020-07-16 02:15:53 +01:00
Richard Davey
1f3b79cf11 Normal map additions
* `WebGLRenderer.normalTexture` is a new property that holds the currently bound normal map (texture unit one).
* `WebGLRenderer.setNormalMap` is a new method that sets the current normal map texture.
* `WebGLRenderer.clearNormalMap` is a new method that clears the current normal map texture.
* `WebGLRenderer.resetTextures` is a new method that flushes the pipeline, resets all textures back to the temporary ones and resets the active texture counter.
2020-07-16 02:15:01 +01:00
Richard Davey
c6ffa0620e TextureTintPipeline.batchSprite and batchTexture has new parameters forceZero which forces use of texture unit zero. 2020-07-16 02:13:08 +01:00
Richard Davey
0b3f125ee0 Removed the Deferred Diffuse fragment and vertex shaders from the project, as they're not used. 2020-07-16 00:21:44 +01:00
Richard Davey
94d333ee1e Use new texture unit 2020-07-16 00:00:49 +01:00
Richard Davey
f2f6d69f1e Update CHANGELOG.md 2020-07-15 18:04:01 +01:00
Richard Davey
d34d52550d Renders using setTextureZero 2020-07-15 18:03:57 +01:00
Richard Davey
99af20aa68 The Particle Emitter Game Object WebGL Renderer function has been updated to support multi-texture units. 2020-07-15 18:03:36 +01:00
Richard Davey
9e9e45261f Added setTextureZero and clearTextureZero
* `WebGLRenderer.setTextureZero` is a new method that activates texture zero and binds the given texture to it. Useful for fbo backed game objects.
* `WebGLRenderer.clearTextureZero` is a new method that clears the texture tha was bound to unit zero.
* `WebGLRenderer.textureZero` is a new property that holds the currently bound unit zero texture.
2020-07-15 18:03:03 +01:00
Richard Davey
2b6de350c5 Update CHANGELOG.md 2020-07-15 17:11:50 +01:00
Richard Davey
71bafd69e1 Update CHANGELOG.md 2020-07-15 17:11:05 +01:00
Richard Davey
216d7cb1fa Updated WebGLRenderer to support new texture assignment
* The property `WebGLRenderer.currentActiveTextureUnit` has been renamed to `currentActiveTexture`.
* `WebGLRenderer.startActiveTexture` is a new read-only property contains the current starting active texture unit.
* `WebGLRenderer.maxTextures` is a new read-only property that contains the maximum number of texture units WebGL can use.
* `WebGLRenderer.textureIndexes` is a new read-only array that contains all of the available WebGL texture units.
* `WebGLRenderer.tempTextures` is a new read-only array that contains temporary WebGL textures.
* The `WebGLRenderer.currentTextures` property has been removed, as it's no longer used.
* `WebGLRenderer.currentTextures` has been removed, as it's no longer used internally.
* `WebGLRenderer.setBlankTexture` no longer has a `force` parameter, as it's set by default.
* `WebGLRenderer.setTextureSource` is a new method, used by pipelines and Game Objects, that will assign a texture unit to the given Texture Source.
* The `WebGLRenderer.setTexture2D` method has been updated to use the new texture unit assignment. It no longer takes the `textureUnit` or `flush` parameters and these have been removed from its method signature.
2020-07-15 17:11:01 +01:00
Richard Davey
9c76ec0389 Large TextureTintPipeline refactor
* The Texture Tint vertex and fragment shaders have been updated to support the `inTexId` float attribute and dynamic generation.
* The Texture Tint Pipeline has a new attribute, `inTexId` which is a `gl.FLOAT`.
* `TextureTintPipeline.bind` is a new method that sets the `uMainSampler` uniform.
* The `TextureTintPipeline.requireTextureBatch` method has been removed, as it's no longer required.
* The `TextureTintPipeline.pushBatch` method has been removed, as it's no longer required.
* The `TextureTintPipeline.maxQuads` property has been removed, as it's no longer required.
* The `TextureTintPipeline.batches` property has been removed, as it's no longer required.
* `TextureTintPipeline.flush` has been rewritten to support multi-textures.
* `TextureTintPipeline.flush` no longer creates a sub-array if the batch is full, but instead uses `bufferData` for speed.
* `TextureTintPipeline.currentUnit` is a new property that holds the most recently assigned texture unit. Treat as read-only.
2020-07-15 17:05:55 +01:00
Richard Davey
3ede28230b Update WebGLPipeline.js 2020-07-15 16:54:18 +01:00
Richard Davey
a21641e19b The Dynamic Bitmap Text Game Object WebGL Renderer function has been updated to support multi-texture units. 2020-07-15 16:54:04 +01:00
Richard Davey
50f10b3d4b The Bitmap Text Game Object WebGL Renderer function has been updated to support multi-texture units. 2020-07-15 16:53:48 +01:00
Richard Davey
446389bb4d The Blitter Game Object WebGL Renderer function has been updated to support multi-texture units. 2020-07-15 16:53:25 +01:00
Richard Davey
ec0914cd0f The Mesh Game Object WebGL Renderer function has been updated to support multi-texture units. 2020-07-15 16:53:09 +01:00
Richard Davey
c0504e4fc1 WebGL.Utils.checkShaderMax is a new function, used internally by the renderer, to determine the maximum number of texture units the GPU + browser supports. 2020-07-15 16:52:26 +01:00
Richard Davey
fd305591ec Added glIndex and glIndexCounter properties 2020-07-15 16:52:01 +01:00
Richard Davey
477b847f13 Config.render.maxTextures is a new game config setting that allows you to control how many texture units will be used in WebGL. 2020-07-15 16:51:40 +01:00
Richard Davey
95ded9c8b3 Update package-lock.json 2020-07-14 22:00:25 +01:00
Richard Davey
7c742f95d2 Generate multi-texture shader source 2020-07-14 17:44:26 +01:00
Richard Davey
9a45517efd Pass max textures to pipeline (disable other pipelines for now) 2020-07-14 17:44:17 +01:00
Richard Davey
587c23ec3c Added maxGPUTextures property 2020-07-14 17:43:56 +01:00
Richard Davey
76689942c0 Add texture ID to shaders 2020-07-14 17:43:29 +01:00
Richard Davey
43beca7bab Create CheckShaderMax.js 2020-07-14 17:43:05 +01:00
Richard Davey
493553c75b Update CHANGELOG.md 2020-07-14 16:49:33 +01:00
Richard Davey
0003d278fd Updated to use new external MVP functions 2020-07-14 16:49:30 +01:00
Richard Davey
06c1336f41 Removed all functions from MVP except init and update and made them all external 2020-07-14 16:49:16 +01:00
Richard Davey
a8faef6692 Created new Model View Projection functions 2020-07-14 16:48:01 +01:00
Richard Davey
5cc387b7df Preparing for 3.25.0 dev 2020-07-14 16:47:43 +01:00
Richard Davey
374d3fcad1 v3.24.1 release 2020-07-14 09:47:03 +01:00
Richard Davey
268a97b084 v3.24.1 types 2020-07-14 09:45:57 +01:00
Richard Davey
4320b6f0ae Update CHANGELOG.md 2020-07-14 09:45:46 +01:00
Richard Davey
dc13060042 Fixed namespace 2020-07-14 09:45:37 +01:00
Richard Davey
bbdf9b9853 Fixed data type 2020-07-14 09:45:30 +01:00
Richard Davey
d03fe0ca6b Updated tsgen test 2020-07-14 09:45:19 +01:00
Richard Davey
3c3008cc04 Update package.json 2020-07-14 09:45:04 +01:00
Richard Davey
d5296287b1 Fixed url type 2020-07-14 09:03:07 +01:00
Richard Davey
44f96de1fd Bump version 2020-07-14 09:02:46 +01:00
Richard Davey
2a2a2eafe8 Reverted PR #5219 because it breaks camera zooming on tilemaps 2020-07-14 08:47:52 +01:00
Richard Davey
f45bde13e1 v.3.24.0 2020-07-13 16:32:28 +01:00
Richard Davey
1c7b853ce5 Updated CleanWebpackPlugin 2020-07-13 16:32:10 +01:00
Richard Davey
4e89ac584b Update README.md 2020-07-13 16:15:45 +01:00
Richard Davey
e428f9cc03 Update CHANGELOG.md 2020-07-13 14:46:01 +01:00
Richard Davey
14c1a3ad99 The ISO Triangle shape would skip rendering the left side of the first triangle in the batch. It now renders all ISO Triangles correctly. Fix #5164 2020-07-13 14:45:58 +01:00