Tips for learning how to make my own shaders
Hi Everyone,
I've been studying Max and jitter for almost half a year now and just about everything I do is with the OpenGl objects.
I use 3d models that are run through instances of jit.gl.slab and have finally decided its time to get my hands dirty with learning how to write my own shaders.
I tried the tut from Andrew (how to write your 1st shader) and couldn't finish it, to me it wasn't clear enough for a complete beginner. example below.
" The program tag allows you to specify a vertex and a fragment program for your shader. Using the “source” argument, you can specify another file for a specific program. In this case we are using “sh.passthrudim.vp.glsl” vertex program, which is one of several handy little utilities in the “jitter-shaders/shared” folder. This particular one just does some basic setup work for you and passes some useful variables to the fragment program."
So I have no idea what that means and why I would use it ! (I found the file “sh.passthrudim.vp.glsl”, checked it out and came to the conclusion it was beyond me !)
So after browsing around the forums and the web I have the following questions.
1 - Where can i learn how to make a shader which explains "everything" i'm doing ?? Should I try and dive into this massive monolith called the orange book or the openGL super bible ?
2 - Any tips on how to learn how to make shaders specifically for jit.gl.slab ??
I've noticed theres a lot of differences between making a shader for a web browser and one for jit.gl.slab.
3 - https://www.shadertoy.com is an incredible site to me. Is it possible to translate these shaders into the world of jitter with jit.gl.slab ??
4 - What version of OpenGL do's Jitter use, and how can i find it out ??
I have no problem studying to learn all these things I just need some pointers so I don't learn "the wrong things".
So any links, book references and such would be greatly appreciated.
Massive thanks in advance
Andro
[oops - ignore]
jitter uses opengl version 2.1
you can find opengl info by opening the OpenGL Status window, found in the Options menu.
Hi Rob,
The link leads back to the original article I tried to get through. So no luck there I'm afraid.
Nice with the options OpenGl view.
Still any tips on websites, or just a good book to get started with would be a massive help.
sorry, i missed that part.
no easy answer, the GLSL orange book is one good place to start.
http://www.amazon.com/exec/obidos/ASIN/0321637631/khongrou-20
the lighthouse tutorials are another.
http://www.lighthouse3d.com/opengl/glsl/
but andrew's article is the best for jitter-related glsl learning.
it takes some time to parse through, but he covers most everything needed to get started.
you might also want to skip gl.slab and glsl for now, and instead focus on gl.pix.
gl.pix uses gen to generate glsl files, thereby allowing you create custom shaders using max patching, and not requiring glsl knowledge. check out the gen patch-a-day series, the jitter/gen example patches found in the Max 6 examples folder, and search the forum for jit.gl.pix for more info.
Thanks a million Rob. I'll take your advice and dive into jit.gl.pix.
The link to the book is open GL 3.1, will this matter a lot with Jitter using version 2.1 ? If not then I'll order it for future study.
And last but not least has cycling 74 made any tutorial videos for jit.gl.pix ?
Equations are something I'm a complete noob with, so if you have any last tips on where I could learn about them in a way which is applicable to jit.gl.pix then I'd be going in the right direction.
+1 for more tutorials on jit.gl.pix. There are tutorials. https://cycling74.com/tutorials/gen-tutorial-2a-the-joy-of-swiz/ ...and a lot of patches to reverse engineer (gen-a-day, jitter-examples...) but if possible, would be nice to see more tuts!
i hear you about tutorials.
perhaps the materials wizards will cook up some more gl specific gen tutorials in the near future.
however one of the major strengths of using gen (ie gl.pix) is the ability to patch and see results on the fly. so i recommend just start patching, and watch the results, and post back to the forum with specific questions. i guarantee you will start learning immediately.
start with something simple, like Max 6.1/examples/jitter-examples/gen/jit.gl.pix.scalebias.maxpat
the basic premise is that every pixel passed to the input is processed by the gen patch, and output. with jit.gl.pix, the format is simplified because every pixel must always have four components (aka color planes R G B A).
once you've played around a bit, go check out the Gen Overview vignette found in the Max docs, and scroll down to the Jitter Gen Objects section.