jit.gl.mesh: how can I get corner pin effect to work with jit.gl.slab?
Following some examples in this thread...
...I've managed to build a corner pin (keystone distortion) patch which works very nicely.
But now I want to combine it with some jit.gl.slab stuff, and I when I do that the texture stops distorting.
I'm sure it has something to do with differences in the way jit.gl.texture and jit.gl.slab pass texture coordinates, but my brain is too small... so I would appreciate some advice from one of the resident glgeniuses.
Example attached.
your patch works as expected for me (both meshes perform proper corner pinning).
you can tell the slab to disable flip attribute by sending the message "sendinput flip 0" to the slab.
i would suggest trying a different shader file, because i think there have been problems with the rota shader on some graphic card - OS combinations.
Thanks for the superquick response.
But I just tried out the patch with a bunch of other shader files, and I'm getting the same result with all of them - the mesh changes, but the texture stays where it is.
and my slab is right side up UNTIL I send it 'sendinput flip 0'.
any other ideas?
(btw I'm on a macbook pro with an NVIDIA 9400M, os 10.6.3)
make sure you don't turn on @tex_map 1 before you test. that will tell the mesh to ignore the tex-coords from the matrix. the mesh should have @tex_map 0.
other than that, maybe try switching the glreadback:
Rob, just to clarify - you're seeing the movie mapped onto both jit.gl.mesh objects without clicking on the 'tex_map 1, tex_plane_t 0. 0.5 0. 0.5, tex_plane_s 0.5 0. 0. 0.5' message?
When I open the patch, both jit.gl.mesh objects are definitely set to tex_map 0 - but A shows the movie, while B is just a changing uniformly colored rectangle (the average of all the pixels in the texture I assume)
And switching the glreadback had no effect, I'm afraid.
So it seems like somehow the slab isn't currently sending out tex-coords - is there some way to force it to?
OK, you were right the first time - changing the glreadback to rtt worked - but not until I restarted Max. So I put jitter glreadback rtt; in my jitter-config.txt and all is good.
I do wish this stuff was documented in a more coherent way somewhere - I know it can generally be found buried away in some thread on this list, but often it's not easy to figure out where to begin, and then it can be difficult to extract the wheat from the chaff.
Perhaps a wiki would be a more useful format for these obscure problems that seem to crop up again and again?
Anyway, thanks again.