jit.gl.texture a few other basics

In the last post we displayed a movie as a gl texture for speed. Can we alter the "resolution" like we did with the jit.matrix object? Yes, but a few things are different. You must use atttributes using the "dim - you can't use arguments for this.

 jit.gl.texture @dim 256 256 @filter none
Below we see it in action. The "@filter none" part allows us to see hard pixels. By default they are linearly interpolated colours. (a bit like vertex colours)
Also - gl_textures always only have 4 planes. A matrix can have up to 32! It is also worth noting that a matrix stores a played movie as ARGB, whereas a gl_texture stores it as RGBA.


To convert a gl_texture to a matrix (say if you wanted to view the texture in a cellblock) it is good to use the "jit.gl.asyncread" object, as that will handle the conversion faster than just plugging the output texture straight into a matrix. (we are moving things from vram to ram & that is not super quick)

Comments

Popular posts from this blog

displaying a jitter movie

hot cold inlets