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).
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.
This eliminates a lot of unused resources. Some will be recreated later,
but for now it keeps development simple.
I'm not actually removing it, because I want to reference where it is
used for the moment.
Clearing was just too complex. It was optimized for edge cases,
and made it hard to create DrawingContexts for multiple cameras
drawing to the same framebuffer.
This currently only handles basic multi-textured images/sprites
through a basic camera. It forms the basis of a major overhaul.
We assume everything is based on independent quads.
Our shaders are initialized with VAOs,
and drawn using instanced quads.
The buffer memory usage is about 1/6th previous.
Most render systems don't work, and WebGLRenderer is a mess.
That's OK; we just needed to get this committed before it got any
more complicated.
It assumes that programs do not change after creation, so these values
are static, and much can be inferred about their behaviour.
Uniform-setting code is implemented and has been tested on Shader.
Attribute binding has not been finished.
- Change `gl` parameter to `renderer`.
- Remove `WebGLPipeline.activeTextures`, which is now covered by
the more universal TextureUnit system.
- Change TextureUnitsWrapper to only bind `activeTexture` if the texture
is not bound to that unit already.
- Remove `gl.isContextLost` check from `WebGLTextureWrapper`.
The process should run without effect if context is lost,
and we skip fetching data if it is not.
Also tweak several related areas:
- Use `glWrapper` in `PipelineManager.rebind`, making WebGL state
redeclaration more succinct.
- Add `WebGLRenderer.glTextureUnits` property.
- Deprecate `WebGLRenderer.textureindexes` property.
- Simplify WebGL context restoration with `glWrapper`.
- Remove `WebGLRenderer.createTemporaryTextures`.
- Remove texture units and binding from WebGLGlobalParameters.
- Change `WebGLTextureWrapper` to take `renderer` instead of `gl` as its
first parameter. This allows us to use `glWrapper` code internally.
- `WebGLTextureWrapper` currently doesn't unbind textures after use,
which might cause issues with framebuffers etc. We'll ensure that
state management makes this a non-issue.
The Wrapper won't do its job until everything uses wrappers,
but this is a start.
API changes:
- WebGLRenderer.blendModes type is now WebGLBlendParameters[]
instead of untyped array.
- WebGLRenderer.updateBlendMode parameters now specify how to use
separate parameters. The function no longer treats the `equation`
parameter as optional.