jit.gen, "type is not a sampler" error
This is another compile error message I only receive in the Max window, with no clues in the gen codebox about what is going on.
To reproduce, save this patch to disk, then open again. Check the max window for this:
jit.gen: [string "gen2.jit.Types"]:207: type is not a sampler
I can delete the code at different places to get it to compile, so I am not sure where or what is mis-defined, or even if something like that is what is causing this. This is very difficult to troubleshoot given the feedback from the language.
SOS =-) thanks!
Jon
line 116, you are calling "nearestpix" but you aren't passing a sampler as the first arg. changing that to pass in a matrix sampler fixes the error.
Rob - this makes complete sense. I made this silly error when reworking my code from several jit.gen's and multiple matrixes to fit into one jit.gen and one matrix with 23 planes.
I completely understand my error and the solution. I just continue to wish jit.gen could better point the user to the line of code that is at fault for these errors, which only appear in the Max window and with no code line location.
greetings from the future.
What.... what's a sampler? And more importantly,
where is the documentation I should have read to find out?
i'm curious, myself, about 'sampler's...anyone feel free to correct me or add as i'd love to learn more about em too... they're referring to the GLSL 'sampler':
https://www.khronos.org/opengl/wiki/Sampler_(GLSL)
the equivalent in Max(aside from writing your own GLSL shader) are the "sample", "samplepix", "nearest" and "nearestpix" ops in jit.gl.pix(i guess in jit.gen, too, but i still have yet to grasp a good reason to use jit.gen 😅)... it's a very powerful op i really enjoy playing with, here's an example:
(reminds me of the lyrics:
"Here's an example, just a little sample
How I could just kill a man!" -Cypress Hill)
1) we're clearly the same age. (god help us)
2) I read and understood 50% of that wikipedia article.
3) Can you explain why, if I use line 4 instead of line 5 I get an error here?
haha, true all that :D
and ya, that's the part that always trips me up(i'm not sure if it's different when you write GLSL, maybe you can get around it, but it's a basic protection built-in that keeps us from sampling things of different formats...). in the max jit... objects, you can't use any input to 'sample' other than the 'in's to jit.gen/jit.gl.pix itself.
in fact @Cycling74 / @RobRamirez: i found a small bug using the patching-style ops in jit.gl.pix, (i'm on a Mac), if you option-shift-drag out a 'sample' op from an existing one, it drags it out connected(even though this is non-functional). normally you shouldn't be able to connect the left-inlet of 'sample' from the output of another 'sample' op(if you disconnect the shift-option-dragged version, you can't manually draw out a patch-chord to then reconnect them again which follows the expected behavior).
no worries/complaints/need-for-fix from me, just letting you know.
@AudioMatt
but also... to try and help more with your patch, i think i might see the same possibilities as you for this: you can still use it somewhat recursively(by using the coordinate input(2nd input), not the left/first sample input)
i tried to recreate the noise from this video of Iñigo Quílez's live coding an 'eye ball':
http://www.iquilezles.org/live/index.htm
by sampling different iterations of jit.bfg and recursively feeding that into the coordinate-input of each successive 'sample' op... you can get some interesting effects by chaining 'sample' through many operations:
First off... I find it odd that it wouldn't let me sample a texture that's of the same format of the input but it's a good rule to know about.
Second, that is REALLY BEAUTIFUL! I have so much to learn in this space!
It's also oddly similar to what I'm working on, with the shai of the tabla in the middle
that is REALLY BEAUTIFUL!...also oddly similar to what I'm working on, with the shai of the tabla in the middle
thanks! i appreciate it... ya, 'dot' product(into 'sqrt') gets you a great starting point for circular 👍
I'm trying to get a distortion to make it look like a rotating 3D sphere. I'll let you know if I ever figure it out.
Hi from the future,
I'm have the same kind error, but I confess I didn't quite understand the solution.
I need to compute the sum of all matrix values.
If I isolate the codebox it works by itself, but together with the remaining patch outputs the same error.
Any help? Thank you