difference between xfade, alphablend, jit.op @* ...

Per's icon

Hi!

I wounder whats the difference between xfade, alphablend, jit.op @*

Max Patch
Copy patch and select New From Clipboard in Max.

Illustrated in the patch below. (save and reopen it to get all the loadbangs and loadmess)

Rob Ramirez's icon

jit.alphablend is only for ARGB matrices, not vertex data. it blends two ARGB matrices together based on the alpha plane of the first matrix input.

Max Patch
Copy patch and select New From Clipboard in Max.

jit.xfade is simply two jit.op @op * and one jit.op @op +

Per's icon

Thanks!

but why does the area move towards upper right when you increase xfade $1?

and how can I keep the area at the same spot if im using the matrixoutput turn off and matrix output turned on. I dont want the noise to move it towards the upper right. I want to keep it centrated

Andrew Benson's icon

Because jit.noise outputs normalized values in the range of 0 - 1. In OpenGL, 0. is the center coordinate of the GL world. To center your noise values in GL space, you can remap the output of jit.noise using jit.op or jit.map to a range where 0. is the center, for example jit.map @map 0 1 -1 1 or jit.op @op - @val 0.5.