Ben Richards
d6bba864a2
Use DrawingContext dimensions for uniform setting.
...
Specifically `uResolution` and `uProjectionMatrix`.
This allows the context to control rendering more accurately.
2024-06-27 18:24:34 +12:00
Ben Richards
7ce2d46d7c
Change Grid to use padding, standard fill and stroke.
2024-06-26 18:33:14 +12:00
Ben Richards
227e5f5208
Add Shape rendering, using the Graphics render nodes.
2024-06-26 15:34:11 +12:00
Ben Richards
8f34a894a7
Improve efficiency in Graphics rendering.
...
We don't copy as many arrays now.
2024-06-25 16:39:17 +12:00
Ben Richards
f6d71c32cc
Fix missing Graphics light shader.
2024-06-25 15:41:04 +12:00
Ben Richards
6ec1bed898
Add pathDetailThreshold for Graphics rendering.
2024-06-25 15:24:31 +12:00
Ben Richards
bd54cbb965
Add lighting and dynamic vertex indexes to Graphics.
2024-06-24 12:36:20 +12:00
Ben Richards
ff4980d85d
Fix buffer initialization issues.
...
Support dynamic index buffer creation.
Fix config handling.
2024-06-24 12:29:47 +12:00
Ben Richards
19f47ff10c
Fix losing camera scissor on cloned DrawingContext.
2024-06-21 20:15:38 +12:00
Ben Richards
0569ecf73b
Add Graphics rendering.
...
Lighting and independent Shapes are not in this commit.
2024-06-21 20:01:28 +12:00
Ben Richards
aa69e4f8b3
Remove roundPixels from DrawingContext, but keep it in QuadLight.
2024-06-21 15:51:26 +12:00
Ben Richards
cbcb14f724
Add roundPixels override to Drawing Context.
...
Also enable roundPixels in Light batch handler.
2024-06-19 11:43:31 +12:00
Ben Richards
b5f775ee2e
Add ParticleEmitter rendering and add lighting support.
...
Also fix some omitted mixin documentation.
2024-06-17 18:49:08 +12:00
Ben Richards
0243cfaa4d
Support tintFill
in tinter node input to SubmitterQuad.
2024-06-17 16:40:46 +12:00
Ben Richards
9994bc9270
Add Blitter rendering and extend SubmitterQuad to be more flexible.
2024-06-17 16:25:38 +12:00
Ben Richards
04f927badf
Make Lighting more flexible.
2024-06-17 14:22:26 +12:00
Ben Richards
8321866151
Add NineSlice rendering.
2024-06-14 17:23:11 +12:00
Ben Richards
8652532d4a
Rename SubmitterImage et al to SubmitterQuad and support elements.
...
This reflects the fact that game objects may render many quads at once.
2024-06-14 17:22:22 +12:00
Ben Richards
9f27366fb0
Fix WebGL rendering compatibilities with DOMElement and Extern.
2024-06-14 14:42:17 +12:00
Ben Richards
f1d7d24f4d
Prevent unintended VAO modifications when modifying global GL state.
2024-06-14 12:46:24 +12:00
Ben Richards
07747d2e18
Use more configurable RenderNodes, and add Lighting component.
2024-06-13 16:26:52 +12:00
Ben Richards
5ad6cc599b
Fix tint interpolation in quads.
...
And anything else that depends upon triangle vertex order.
2024-06-12 21:14:24 +12:00
Ben Richards
0f2d223f1f
Use generic vertex buffer.
2024-06-11 19:13:13 +12:00
Ben Richards
ff71ee8419
Associate data and data views with buffers.
2024-05-31 21:20:31 +12:00
Ben Richards
d9c483e684
Update const.js
2024-05-31 13:11:35 +12:00
Ben Richards
28e1008c74
Add documentation and tweaks to Light render nodes.
...
Override `LightBatchHandler.updateTextureCount` because it inherits a
function which does unnecessary shader recompilation.
Allow LightBatcher to take a config.
2024-05-30 21:16:21 +12:00
Ben Richards
34736ce1f8
Add Light rendering.
...
Use `gameObject.setRenderNode('LightBatcher')` to assign the render node.
2024-05-29 21:10:13 +12:00
Ben Richards
5c4d978556
Add onRunBegin
and onRunEnd
to RenderNodes.
...
Also make `manager` available in `BatchHandler._copyAndCompleteConfig`.
2024-05-29 21:07:04 +12:00
Ben Richards
82738c78f2
Fix BatchHandler affecting unintended VAOs.
2024-05-29 21:01:08 +12:00
Ben Richards
d1a38d55c0
Remove renderer from RenderNode parameters.
...
It's easy to access via the manager parameter.
2024-05-28 19:36:03 +12:00
Ben Richards
7e16caeed7
Make render nodes customizable.
...
Game objects can now change their render node, in place of a pipeline.
Render nodes can be created with custom values,
to change their behavior or relationships.
Several nodes are renamed.
Program Wrapper now supports defining layouts with strings instead of
GLenums, to facilitate render node customization.
2024-05-27 18:32:34 +12:00
Ben Richards
9940554eba
Optimize Program Wrapper.
2024-05-21 14:49:24 +12:00
Ben Richards
fedf494a4c
Fix FillRect.
...
It wasn't updated to the latest batch paradigm. This fixes camera
fill, flash, and fade.
2024-05-20 17:03:41 +12:00
Ben Richards
261399642e
Increase batch size to 16384.
...
This is the natural limit of 16-bit unsigned integer vertex indexes.
2024-05-17 17:17:49 +12:00
Ben Richards
6bbfde50da
Use transformed elements instead of instanced rendering.
...
There is simply no good way to control instanced rendering with batches,
and there is no efficient way to use hardware transform when using
vertices to render.
2024-05-17 16:34:04 +12:00
Ben Richards
ce6324837e
Transfer texture unit index array to WebGLRenderer.
...
This makes it universally accessible to any shader.
2024-05-16 12:08:20 +12:00
Ben Richards
8c5abcd060
Fix parallel texture unit check.
...
It was swapping mobile with desktop preferences, whoops.
2024-05-15 16:41:29 +12:00
Ben Richards
c43a45d985
Allow RenderNodeManager to change parallel texture unit count.
...
The BatchTexturedTintedRawQuads node listens to this, and will
recompile its shader to the indicated performance strategy.
2024-05-14 17:03:00 +12:00
Ben Richards
d120e0a4b5
Fix invalid create and destroy code in Program Wrapper.
...
There is no `deleteUniformLocation` command. (Thanks, AI hallucinations!)
2024-05-14 16:14:56 +12:00
Ben Richards
e57ed463b2
Reduce accessor use in VAO wrapper.
2024-05-13 15:25:50 +12:00
Ben Richards
c8c170672d
Use sub-batches to handle many textures in batches.
...
This is the way 3.80 handles things, and is useful for performance on
mobile devices where we might only use 1 texture unit per sub-batch.
2024-05-13 15:23:01 +12:00
Richard Davey
2c1ad33e1a
Update const.js
2024-05-02 14:41:51 +01:00
Ben Richards
717bd96879
Fix the last missing data from DrawingContext clones.
...
I hope.
2024-05-02 18:42:42 +12:00
Ben Richards
e7f1269c12
Fix DrawingContext missing critical data.
2024-05-02 18:36:55 +12:00
Ben Richards
f3d1da68a9
Fix and tidy code.
...
Fix camera background color not working (a call signature changed).
Fix render graph only recording the last camera
(by adding a synthetic root node to the graph).
2024-05-02 16:47:28 +12:00
Ben Richards
65e69a8369
Unify flipped crop handling.
2024-05-02 14:41:01 +12:00
Ben Richards
ee8ebbdd1c
Render Video using the new system.
2024-05-01 18:36:29 +12:00
Ben Richards
f86a353a2d
Render Text using the new system.
...
It may be more correct than ever, now that we've standardised it.
2024-05-01 17:34:23 +12:00
Ben Richards
3140edf0c3
Fix Text UV updates.
...
Previously, Text didn't update the TextureSource dimensions,
so its UVs were identical to resolution.
They should have been normalized to the 0-1 range.
It used `MultiPipeline.batchTexture` to render, which accommodated
these UVs.
These changes update the dimensions when Text changes its canvas size,
and this makes normalized UVs available.
2024-05-01 15:58:45 +12:00
Ben Richards
48d1164c16
Swap order of src
and drawingContext
parameters.
...
This makes the standard `renderWebGL` parameters more similar to their
original state: we're just replacing `camera` with `drawingContext`.
2024-04-30 18:09:25 +12:00