Conversation
bf2e3bb to
df207d0
Compare
| video: 'quad.video' | ||
| video: 'quad.video', | ||
| /* support for raw texture data */ | ||
| texture: 'quad.texture' |
There was a problem hiding this comment.
We need to add capabilities[quadFeature.capabilities.texture] = true; near the end of src/webgl/quadFeature.js to indicate that this is supported (so programs that query by support get the webgl renderer).
There was a problem hiding this comment.
I noticed that there were false values in there (specifically for the canvas and video) so I added capabilities[quadFeature.capabilities.texture] = false to the src/canvas/quadFeature.js as well.
| * Set Raw Texture data using Uint8Array | ||
| * | ||
| * @param {object} texture texture object to load. | ||
| * type: 'RGB' | 'RGBA' | 'Luminance' | 'LuminanceAlpha'. |
There was a problem hiding this comment.
If you pass RGB, doesn't this still expect data in RGBA? Should we remove the RGB option if it isn't directly supported?
There was a problem hiding this comment.
And, I think the jsdoc of these sub properties should be
* @param {object} texture texture object to load.
* @param {string?} texture.type One of 'RGB' | 'RGBA' | 'Luminance' | 'LuminanceAlpha'.
* @param {Uint8Array} texture.data Array representing the format based on the type
* @param {number} texture.width width of the texture
* @param {number} texture.height height of the texture
There was a problem hiding this comment.
Yeah, I'll remove RGB, it was part of my early testing. Having RGBA should cover most of the use cases.
Added a new .data({texture}) option to webGL quads:
Changes:
quadinternally has a new property calledimageTextureif it has this it will skip thequad.imageconditional in the_updateTexturesand use this instead._cleanupis updated to conditionally check for existence of items before removing and iteration because of the changes to properties available_updateTexturesfunction to handle either an image or direct texture being loaded. The previous version used two conditionals with a lot of duplicated code. I've refactored it to take the texture based on the existence of either aimageTextureor aimagewith priority given to theimageTextureif it exists. If you want to see the simplified version it should be in the PR history beforefix: refactor _updateTextures to remove code duplicationm_textureis a new property that represents a texture that doesn't have an associated imagesetupfunction that usestextImage2Dbased on the texture type and sizesetTexturefunction to manunally set the newm_textureas