[PD] [GEM]: GL Shader Language

vade doktorp at mac.com
Wed Jun 27 20:00:08 CEST 2007


Hi. Hans pointed me to this thread off list. Im definitely interested  
in porting some of my shaders to GEM, and making some easy to use  
abstractions that you can plop down in the GEM processing chain.

I actually emailed Chris Clepper off list earlier in the week  
regarding this. It looks like, however, that GEM and Jitter handle  
some things slightly differently, enough so where I may have to  
maintain more than one version of the shader code for both  
environments, or, maybe im just dont get whats going on. Either way  
im going to take a closer look at this friday. My goal is to have  
interchangeable shaders (Jitter uses an XML file to describe the  
parameters and declare what vertex and fragment program is loaded,  
but besides that 'jxs' file, id like the .vert and the .frag to be  
basically interchangeable). Id also include some basic abstractions  
for wrapping the shaders so you could just drop a

[v001.duotone] into the gem pipeline and get two tone processing for  
your textures. etc etc.

Once I get a basic set of shaders done that I am happy with, ill  
definitely be releasing them to the GEM community as well. Im also  
pretty new with this shader stuff, so expect some hiccups.

Right now the shaders I am working on are:


Mixers : A/B with blendmodes like overlay/hardlight etc
Mixers : A/B/C where C is mask based on luma or alpha

Effects:
	Black and White
	Texture clamping (makes cool lines in the middle of the image)
	Color Separator (separate r g b planes in x/y)
	Dent
	Duotone
	Exposure
	Fader (fade to black/white, nice at the end of a processing chain)
	Light Tunnel
	Pinch
	Posterize
	Shred (interesting pattern/repetition creation)
	Stretch
	Threshold (high contrast colors)
	Twirl

	and some more

3D shaders
	
	Vertex noise
	Normal Map
	Sin distortion

Because Jitter has a library of already created shaders, I may port  
some of those over so GEM folks have them as well, like saturation,  
contrast, brightness, and so on. The basics.
	
Peace :)


On Jun 26, 2007, at 3:09 PM, Cypod wrote:

> What books or webpages are out there for learning how to write glsl
> shaders, for use in 3D?
>
> http://en.wikibooks.org/wiki/Programming:OpenGL
>
> Has anyone read this one OpenGL(R) Shading Language (2nd Edition)
> http://tinyurl.com/ysun6z
>
>
> Are there any third party applications for writing glsl shaders that
> can be easially ported over to PD?
>
>
>
> On 6/26/07, Cypod <cypod25 at gmail.com> wrote:
>> I am hoping to learn more about programming by using PD, but it  
>> would also
>> be nice to crank out some good looking shaders in a timely manner
>>
>>
>>
>>  On 6/25/07, Alexandre Quessy <listes at sourcelibre.com> wrote:
>>> HI Cyrille and others.
>>>
>>> I modified the abstraction to make opening the two files easier. It
>>> uses file/parentfolder from the PdMtlAbstractions. (try it !! It
>>> answers your question)
>>>
>>> For the C programming and such, I just meant that it is nice if  
>>> we can
>>> tend to make Pd easier to use for people that are not that much used
>>> to advanced programming. A good documentation and a nice structure
>>> helps a lot...
>>>
>>> a
>>>
>>> 2007/6/23, cyrille henry < cyrille.henry at la-kitchen.fr>:
>>>>
>>>>
>>>> Alexandre Quessy a écrit :
>>>>> Eh Jack !
>>>>> Very nice examples, yes. Cyrille, do you think that one should
>>>>> understand C programming in order to use Pd? I don't.
>>>> i don't see your point here.
>>>> glsl programming is not very diferent from C. So, understanding  
>>>> C is
>> good for learning glsl.
>>>> but you don't nead glsl in order to use pd.
>>>> you just need glsl if you want to do very heavy pixel processing at
>> 50fps / 1024x768 without using any  CPU time by exemple.
>>>>
>>>>
>>>>> Of course, its
>>>>> low-level orientation makes it perfect for someone to learn lower
>>>>> level stuff.
>>>>>
>>>>> Anyways, I added an abstraction for shaders in the  
>>>>> PdMtlAbstractions.
>>>>> See https://devel.goto10.org/pdmtl/browser/trunk/pdmtl/gems
>>>>
>>>> cut / paste the help file is (for me) easier to use, as i  
>>>> usually put
>> the shader in in the same directory as my patch, so i don't nead  
>> to provide
>> the full path for the shader. (and the patch could run on other  
>> computer
>> without changing all path).
>>>> is there a solution for an abstraction to know the directory of  
>>>> it's
>> parent patch?
>>>>
>>>> cyrille
>>>>
>>>>>
>>>>> a
>>>>>
>>>>>
>>>>> 2007/6/19, jack at rybn.org <jack at rybn.org>:
>>>>>> Yep, very interesting example !
>>>>>> You can "boost" Gem with glsl object.
>>>>>> Is there workshop in Paris about that Cyrille ?
>>>>>> I think, that it would be interesting to do.
>>>>>>
>>>>>> Jack
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Hans-Christoph Steiner a écrit :
>>>>>>>>
>>>>>>>> On Jun 17, 2007, at 6:58 AM, cyrille henry wrote:
>>>>>>>>
>>>>>>>>> hello,
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Kyle Klipowicz a écrit :
>>>>>>>>>> Ooop please send any elementary examples of these things.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> i post a few very diferents shader and the pd patch to use  
>>>>>>>>> them
>>>>>> here :
>>>>>>>>>
>>>>>>>>> http://drpichon.free.fr/gem_glsl_ch_200070617.zip
>>>>>>>>
>>>>>>>> Wow, these are some nice examples, these should be included  
>>>>>>>> in the
>>>>>>>> "examples" section of Pd-extended.
>>>>>>>>
>>>>>>>
>>>>>>> well, i think i should clean up some code and check licence  
>>>>>>> for the
>>>>>> shader
>>>>>>> i did not write.
>>>>>>> where should i put them in order to include them in pd-extended?
>>>>>>>
>>>>>>> cyrille
>>>>>>>
>>>>>>>> .hc
>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> I got
>>>>>>>>>> confused by the Gem docs (they don't explain OpenGL as
>> thoroughly as
>>>>>>>>>> the vanilla Pd-docs explain DSP).
>>>>>>>>>
>>>>>>>>> Gem doc aim is to explain gem specific stuf. but in order  
>>>>>>>>> to use
>> Gem,
>>>>>>>>> you also need a good openGL book.
>>>>>>>>> (you can find lot's of them)
>>>>>>>>>
>>>>>>>>> cyrille
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ~Kyle
>>>>>>>>>>
>>>>>>>>>> On 6/17/07, cyrille henry <cyrille.henry at la-kitchen.fr>  
>>>>>>>>>> wrote:
>>>>>>>>>>> hello,
>>>>>>>>>>>
>>>>>>>>>>> Alexandre Quessy a écrit :
>>>>>>>>>>>> Hi all !
>>>>>>>>>>>> The Toon.vert and Toon.frag shaders don't seem to work  
>>>>>>>>>>>> quite
>> well
>>>>>>>>>>>> here. I only get some kind of darker or lighter grey  
>>>>>>>>>>>> depending
>> on
>>>>>>>>>>>> the
>>>>>>>>>>>> value of the "Phong" variable I set it to have. I am using
>>>>>>>>>>>> Pd-extended
>>>>>>>>>>>> 0.39-2 test 5 on Ubuntu Linux Intel. Gem is 0.91-cvs  
>>>>>>>>>>>> compiled
>>>>>> on Mar
>>>>>>>>>>>> 16 2007. Should I generate something any better ?
>>>>>>>>>>> this is exactly what the toon shader is aiming to do.
>>>>>>>>>>> look at it's code to undersant why.
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Anyone has an other GLSL shader to suggest to try it with ?
>>>>>>>>>>>
>>>>>>>>>>> yes, google has a lot.
>>>>>>>>>>>
>>>>>>>>>>> i have a few other exemple on my computer, tell me if you're
>>>>>> looking
>>>>>>>>>>> for some specific stuf.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> cyrille
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks !!
>>>>>>>>>>>>
>>>>>>>>>>>> a
>>>>>>>>>>>>
>>>>>>>>>>>> 2007/6/16, chris clepper <cgclepper at gmail.com>:
>>>>>>>>>>>>> GEM is a bit easier to deal with for shaders since  
>>>>>>>>>>>>> there is
>> no
>>>>>> need
>>>>>>>>>>> to do
>>>>>>>>>>>>> any specific wrapper.  Any ARB_ vertex or fragment  
>>>>>>>>>>>>> shader and
>> any
>>>>>>>>>>>>> GLSL
>>>>>>>>>>>>> shader you find on the web can work in GEM without
>> modification.
>>>>>>>>>>> In some
>>>>>>>>>>>>> cases you might need to change something in the shader  
>>>>>>>>>>>>> text
>> to
>>>>>> deal
>>>>>>>>>>> with
>>>>>>>>>>>>> rectangle vs 2D textures.
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> On 6/16/07, Cypod <cypod25 at gmail.com> wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On the cycling74 webpage there is an interesting article
>> about
>>>>>>>>>>> writing
>>>>>>>>>>>>> shaders for jitter:
>>>>>>>>>>>>>>   http://cycling74.com/story /2007/5/23/181113/507
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> is there a similar function available for GEM? Has anyone
>> had
>>>>>>>>>>> experience
>>>>>>>>>>>>> with doing this?
>>>>>>>>>>>>>>
>> _______________________________________________
>>>>>>>>>>>>>> PD-list at iem.at mailing list
>>>>>>>>>>>>>> UNSUBSCRIBE and account-management ->
>>>>>>>>>>>>> http://lists.puredata.info/listinfo/pd-list
>>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>> _______________________________________________
>>>>>>>>>>>>> PD-list at iem.at mailing list
>>>>>>>>>>>>> UNSUBSCRIBE and account-management ->
>>>>>>>>>>>>> http://lists.puredata.info/listinfo/pd-list
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>> _______________________________________________
>>>>>>>>>>> PD-list at iem.at mailing list
>>>>>>>>>>> UNSUBSCRIBE and account-management ->
>>>>>>>>>>> http://lists.puredata.info /listinfo/pd-list
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> PD-list at iem.at mailing list
>>>>>>>>> UNSUBSCRIBE and account-management ->
>>>>>>>>> http://lists.puredata.info/listinfo/pd-list
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>
>> ------------------------------------------------------------
>> ----------------
>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>> http://at.or.at/hans/
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> PD-list at iem.at mailing list
>>>>>>> UNSUBSCRIBE and account-management ->
>>>>>>> http://lists.puredata.info/listinfo/pd-list
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>> --
>>> Alexandre Quessy
>>> http://alexandre.quessy.net
>>> http://www.puredata.info /Members/aalex
>>>
>>> _______________________________________________
>>> PD-list at iem.at mailing list
>>> UNSUBSCRIBE and account-management ->
>> http://lists.puredata.info/listinfo/pd-list
>>>
>>
>>
>>
>> --
>> B~
>> www.cypod.co.nr
>
>
> -- 
> B~
> www.cypod.co.nr
>
> _______________________________________________
> PD-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/ 
> listinfo/pd-list

v a d e //

www.vade.info
abstrakt.vade.info



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20070627/a265d950/attachment.htm>


More information about the Pd-list mailing list