You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#5101 introduced RenderTexture and #5190 introduced Texture. There's also #4811, an older take on the same idea by @mourner, and existing code that uses texture-related WebGL calls directly without using either class.
We should refactor and sort this out. Here's my proposed design:
However, the way that native does texture binding is not quite right. All that should be publicly exposed are property setters and methods on the Texture class. Internally, a property setter should:
Check the tracked state, and exit if it's a redundant operation.
If not, then check that tracked state of the texture binding for the current texture unit. If changing that is a redundant operation skip it, otherwise bind the texture.
Update the state.
For texture handling that's not connected to a draw call (e.g. stuff that happens in the upload step), just always use texture unit 0. For texture handling during a draw call, there should be a way of supplying Texture references as the value of uniforms, and having the internals handle assigning unique texture units, binding the textures, and setting the unit identifiers with glUniform*.
The text was updated successfully, but these errors were encountered:
#5101 introduced
RenderTexture
and #5190 introducedTexture
. There's also #4811, an older take on the same idea by @mourner, and existing code that uses texture-related WebGL calls directly without using either class.We should refactor and sort this out. Here's my proposed design:
gl::State<T>
and associated value traits.Texture
class. Internally, a property setter should:Texture
references as the value of uniforms, and having the internals handle assigning unique texture units, binding the textures, and setting the unit identifiers withglUniform*
.The text was updated successfully, but these errors were encountered: