Best way to set a 4-plane matrix to alpha = 100%
[jit.noise] --> [jit.brcosa].
brcosa will not accept any matrix with more or less than exactly 4 planes.
But I don't want randomized alpha. I want alpha to be 100% across the board.
I can unpack the matrix, jit.fill and replace one plane with a constant value... OK.
But jit.fill help says "fill one plane of a named matrix" so the [jit.unpack] shouldn't be necessary, right?
I thought this approach would prepare the 4 plane data, and then jit.fill would overwrite one plane. But that isn't happening (no plane is a constant 255 everywhere).
Thanks.
hjh

You were only filling the first cell with jit.fill. You need a list which length is equal to the number of dimensions to fill the whole matrix (i think?). Jit.gen is much easier too use imo
I made a mistake btw. and it is a bit confusing but everything in Jit.Gen (and afaik also .pix) is treated as a float between [0.0-1.0] internally so [vec 1.] inside Gen actually outputs as 255. Keep that in mind!
and the reason why [vec 255] worked because it clips values above 1. For example the output from [vec 2.] is also 255 even though a char-matrix is capable of handling a value like 2...

> You were only filling the first cell with jit.fill...
OK, appreciate this, I'd thought it might wrap-index the incoming list.
So if it's a large matrix then you need a massive list ("maximum list length limit is 32,767")... and gen is the better way.
The gen documentation is a true marvel of clarity btw :lol: so... maybe it's gonna take too much time.
hjh
"I'd thought it might wrap-index the incoming list."
No but that would definitely be a nice feature though. Your comment about the maximum listlength is indeed why i personally stay away from using Max objects when processing matrices. I generally use jit.gen/pix for pretty much anything.
And yeah, the documentation is lacking which is especially painful considering the excellent documentation of Max/Jitter itself. You just have to bite the bullet but it's well worth the headaches if you have the time though :) There's some good tutorials in the "learn-section" that will definitely help such as this one:
https://cycling74.com/tutorials/my-favorite-object-jit-gl-pix
To simplify the operations, you can also take advantage of the limited range of values that char matrices can represent, making the alpha plane clip:
Also, quick note, I saw you're considering the alpha to be the last plane (RGBA), but in Jitter, alpha is the first (ARGB) (unless you're dealing with textures and gl objects)
"Also, quick note, I saw you're considering the alpha to be the last plane (RGBA), but in Jitter, alpha is the first (ARGB) (unless you're dealing with textures and gl objects)"
Oh right! I always mix up which one of the two switched the Alpha-channel. So if i'm not mistaken Jit.gen is argb while jit.pix is rgba. And only jit.pix (and i assume jit.gl.pix as well) are the only objects that switch this right?
jit.pix doesn't swap the planes, while jit.gl.pix does.
Look at this patch to see which objects do the ARGB<->RGBA conversion:
> Look at this patch to see which objects do the ARGB<->RGBA conversion:
That's very useful, thanks! I did understand from the documentation that matrix display uses a different channel order from gl textures, but it would have taken me a long time to figure out the details.
hjh