shader for cropping

laserpilot's icon

not sure if this is useful to anyone else..I modified the edgewipe shader so that the edgefade can be adjusted and used as a hard or soft edge 4 side crop instead..the individual edge softness can be adjusted with the parameter 'edgefade' but just .0001 goes a long way, so be gentle

now someone needs to make an easy 4 corner pin shader (please??..for running multiple inputs at once) and we'll be in business for crazy projections

FP's icon
laserpilot's icon

thanks..i guess the mesh thing works well enough..I'll have to give it a try sometime soon, although a shader would be a little more compact..is there an advantage to the matrix-> mesh method?..here is a help patch for my cropper ..not sure why it wasnt working for you:

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

and the shader code for good measure:

    generates gradient alpha for edge-blending
    

        hard edge
        amount of gradient

FP's icon

ha yes thx.
i didn't understant i had to put at least 0.0001 edgefade.
why ? :-)

> is there an advantage to the matrix-> mesh method?
i don't know.
i would like to crop before to use this keystone. for now i can't find
how to.
if i use a shader like you did, the dimension stays as original movie.
so it doesn't work like i want.
>

--
fabrice planquette
elt@altern.org
--

FP's icon

by the way. how do you do to insert your shader in my keystone's patch ?
did you try ?

it doesn't work here.

laserpilot's icon

i can't make my shader work in your keystone patch either..i just started using gl stuff a week ago so I'm sure there is something im missing..its probably something weird with the way gl.mesh is mixing things together, perhaps throwing away the alpha channel, but im not sure

fusion's icon

I'm trying to find a good keystone patch. The patch above is not a real keystoner. It creates a polygon with 2 triangles, so you end up with this nasty crookedness across the diagonal.

I tried both of hcblije's max-built programs, but they are very unreliable under windows on most systems.

I just can't find something good on the forums. Can anyone help?

Thanks

Rob Ramirez's icon

four corner pin patch.

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

fusion's icon

Thanks so much for this. It was a life saver. I meant to reply several months back.

If it helps anyone else, I have created a more full-featured implementation, with 3+ different keystone windows, interactive pin movement for each, easy to extend (I hope), instructions for use, etc.

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

fusion's icon

Oh yeah, just remember to save/re-load after you paste; or else activate all the "loadbang"s and "loadmess"es.

FP's icon

thx but abstractions are missing.
mpCornerUI + mpCornersMesh

fusion's icon

Whoops. I'm new to posting patches. Here are the 2 sub-patchers:

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

1) mpCornerUI:

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

2) mpCornersMesh: