[sharing] jit.gl.scissor (gl equivalent of jit.scissor)
Hi all
As the title indicates, here is a gl version of jit.scissor.
Hope this can be useful.
I also demonstrates how to use jit.gl.shader and texture with jit.gl.multiple. And most importantly how to use matrices to
tweak shader params
phiol
Hi Phiol,
Good to know the gl.pix to shader and shader's params control via gl.multiple !
thanks
Great work Phiol !
thanks a lot for the comments matmat & andro.
Funny how the shader to multiple is in jit.multiple's help file and i'd over looked it :-)!
Also, As my other post topic say, would you guys know if
possible to stack/have many jit.shader to a single gridshape like we can with textures? Would be awesome in jit.gl.multiple.
Also, in another post, Rob confirms that the jitgl.pix export is not working properly , so we have to use the full_source_code / copy-paste and save as .jxs file method for now.
thx again for the comments :-)
phiol
I don't see the jit.gl.pix version of it. I guess it is possible without using jit.gl.multiple and doing that all in jit.gl.pix.
Any ideas?
Hi julien,
I,m sure someone here could do it in 2 seconds, butI wasn't able to figure it out.
I didn't spend to much time.
here is a basic setup with gl.pix using sample
My problem is that I can't figure out how to change the anchor point for correct zooming in.
I know I would need a 5X5 dim matrix input and then figure out with snorm of /
.... etc... maybe cares to teach us :-)
Hello, I don't undesrstand.
That's not the same idea or I misunderstood it.
I'd need to use this example for :
- having the picture cut into vertical slices (not the same picture replicated in slice, "real" slices of the pictures)
- offset the vertical slices a bit up, a bit down.
not sure I can do that only with sample in jit.gl.pix maybe a combination of some
hello julien .
did you toy around with the initial patch?
I am using td.rota for it's zoom and anchor point functions. if you play around with the zoom value , you' ll see that it's the same image zoomed in but starting from different anchor points. These anchorpoints are positionned using a norm.
when zoomed in , this gives the illusion of cut out pieces of the same image that are gathered together to create a puzzle.
So, yes it is the same concept that is happening here in gl.pix. But I find the equation to change the anchor points . I am not versed enough with glsl and gl.pix to recreate the effect in gl. pix.
maybe someone could help out.
moreover, why can't you use my jit.multiple version??
if you use jit.gl.gridshape @dim 2 2 . then you you can create quite a lot of instances before it become heavy on the gpu. But you wouldn't want that (many slices)with the scissor concept anyway.
hope this clearafies things
phiol
you mean something like this but addressing each slice individually
I think Julien wants exactly the jit.scissor. This is a problem in gl.pix because you can't create outputs on the flow, so even though you do the math to subdivide the texture with simplified attributes like @rows and @columns your gl.pix won't create the corresponding outputs. Maybe this is a bug of gl.pix 'cause the attribute @outputs exist but does nothing. Maybe there is a work around to this with gl.pix and poly~
Basically, I don't want each slice popping out but the result (all slices reglued) only.
When I'll go back to my studio tomorrow, I'll give it a try with for() in codebox and textures sampling... with offset.
It should work... Got the idea while reading you so thanks a lot.
Maybe Rob would come with a trick :-D
Maybe this patch by Rob helps to achieve what you want.
@2k
it
Again this depends on how many slice julien has in the 1st place.
At this point I suggest using either my 1st patch to keep it dynamic
whatever works :-)
phiol
for further reference ... https://cycling74.com/forums/jit-gl-pix-poly-tests
and of course, I retrieve this dynamic/static output in another paradigm.
I think I'd have to use something like: dynamic but within a range and truncating/crop to a subset.
I mean: let's say we have 10 slices calculated and the dynamic parameter is to use only n (n between 1 and 10)
Not sure.
I drop that at the moment...