Forums > Jitter

Depth of field style blur shader + global illum/soft shadow shader?

January 18, 2009 | 3:43 pm

Im curious if anyone has a depth of field style blur shader, or a global illumination/soft shadow shader. I have been looking around at a bunch of online resources, and Ive seen things like this in OpenGl, but I just dont know how to make shaders, or if these things are even possible in jitter/with my radeon 1600x in my macbook pro.

I am also curious if anyone knows of a good resource to learn to create shaders/slabs. Ive looked at the tutorials that a.benson did on the c74 site, and Its not clicking in my head. I can see how powerful these can be, I just wish I knew where to start.

Thanks in advance
NCRIII


January 18, 2009 | 4:02 pm

http://3dshaders.com/home/index.php?page=shop.browse&category_id=1&option=com_virtuemart&Itemid=34

for example, has anyone gotten the shaders from the orange book to work in jitter? it looks like the ambiant occlusion shader does what I want in therms of soft shadow style.. I tried saving the shaders and opening them in jitter but no luck.


January 18, 2009 | 6:19 pm

I started by looking at the orange book. It took a lot of effort to get
some of the examples to work, but for others it was simply a matter of copy
and paste. I’m not a programmer and have a lot of difficulty translating my
ideas into code and I find that I often need to read something about 25
times before the obvious hits me and I get to understand.
However, something has lodged in my head because I had a quick look at the
code for the ambient occlusion shader you point to with your link and see
that one of the variables in the vertex shader is this:

attribute float Accessibility;
>

You will need to set up the shader code in one of two ways:

1. Have a look at the shader that Wesley Smith posted a while ago
illustrating how to use attribute variables, and I think that’s what Vade
was using in the rutt etra file he posted recently;

2. the easier route: change the attribute variable to a float and expose it
in the jxs file as an float input parameter.

It should then work, I think.? Post back here if not and I’ll try to get an
example of it for you.

pelado

http://www.pelado.co.uk

http://www.wiki.pelado.co.uk

On Sun, Jan 18, 2009 at 5:02 PM, Nicholas C. Raftis III <
Dynamicell@hotmail.com> wrote:
>
>
http://3dshaders.com/home/index.php?page=shop.browse&category_id=1&option=com_virtuemart&Itemid=34
>
> for example, has anyone gotten the shaders from the orange book to work in
jitter? it looks like the ambiant occlusion shader does what I want in
therms of soft shadow style.. I tried saving the shaders and opening them in
jitter but no luck.


January 18, 2009 | 6:42 pm

Well, this is what I meant by changing it to a float variable. this is the code taken from the orange book online files CH13-AmbOcc.
see attached.

pelado


January 18, 2009 | 6:52 pm

Oh and another thing, I looked into depth of field shaders and couldn’t get
anything satisfactory on my set up, which is a powerbook G4 and OS X
10.4.x. I think you should be able to get them to work with your card if
you are using leopard. Leopard gets you in to the next version of GLSL
which is not available to my graphic card on Tiger.

pelado

>
>



ico
January 18, 2009 | 8:01 pm

If you would like to learn more about the shaders, check out Shaders Ahoy!
package (http://ico.bukvic.net/Max/) that offers a relatively well
documented overview of basic pixel-based shader operations and their
integration into Max. The package also replicates most of the photobooth
effects that are for the most part mathematically simple to comprehend.

Best wishes,

Ivica Ico Bukvic, D.M.A.
Composition, Music Technology
Director, DISIS Interactive Sound & Intermedia Studio
Assistant Co-Director, CCTAD
CHCI, CS, and Art (by courtesy)
Virginia Tech
Dept. of Music – 0240
Blacksburg, VA 24061
(540) 231-6139
ico@vt.edu

http://www.music.vt.edu/faculty/bukvic/

> —–Original Message—–
> From: jitter-bounces@cycling74.com [mailto:jitter-bounces@cycling74.com]
> On Behalf Of Nicholas C. Raftis III
> Sent: Sunday, January 18, 2009 10:43 AM
> Subject: [jitter] Depth of field style blur shader + global illum/soft
> shadow shader?
>
>
> Im curious if anyone has a depth of field style blur shader, or a global
> illumination/soft shadow shader. I have been looking around at a bunch of
> online resources, and Ive seen things like this in OpenGl, but I just dont
> know how to make shaders, or if these things are even possible in
> jitter/with my radeon 1600x in my macbook pro.
>
> I am also curious if anyone knows of a good resource to learn to create
> shaders/slabs. Ive looked at the tutorials that a.benson did on the c74
> site, and Its not clicking in my head. I can see how powerful these can
> be, I just wish I knew where to start.
>
> Thanks in advance
> NCRIII
> –
> -=ili!ili=- http://www.Axiom-Crux.net -=ili!ili=-


January 19, 2009 | 4:42 am

thanks guys, Ill try these out and see if I can make some progress. I dont know what happened to my programming brain, I grew up using gwbasic and qbasic in dos when I was pretty young, and I took advanced placement C++ in high school, but for some reason after I went to art school and started using max/jitter that part of my brain stopped working and I now am having a hard time getting back into that world of typecoding. Thats why I fell in love iwth jitter in the first place, It allowed me to program in a much more visual way, and just fit with the way my brain works.

Im going to look into these links you guys sent and post later tonight. I hope I can get some of these working, and start making some shaders of my own, they just seem so powerful from what ive seen from others like vade and benson.

as far as a depth of field shader, wouldnt a modified blur slab work? one that detects distance? Im not sure if I understand fully yet the difference between slabs and shaders, and if slabs can use 3d data. im gonna keep trying.

Ive been holding off on upgrading to 10.5 because Im worried certain things wont work, and one of my favorite sound design apps: metasynth doesn’t work properly in 10.5 and I use it all the time.. but maybe its time to move on and just use meta on my desktop.


January 19, 2009 | 5:02 am

the ambiant occlusion shader seems to be working, but everthing is blue and green, maybe I need to set up some parameter variables or something. Here goes nothing

ALso the shaders ahoy is still above my head, they are nicely commented, but its gonna take me a bit to really get whats going on with all the different texcoord + vector math stuff. Thanks though.


January 19, 2009 | 9:49 am

The ambient occlusion shader has parameters already set up that change the
colours. You might find my p.jit.gl.shader patch useful for auto exposing
the parameters for shaders, available at

http://wiki.pelado.co.uk/jitter/p.jit.gl.shader

Apple have some really useful pages that let you know what your graphics
card is capable of under each operating system

http://developer.apple.com/graphicsimaging/opengl/capabilities/

I’d say that the difference between the slab object and the shader object is
that slabs utilise shaders internally but also sort out the geometry for you
and bind the results to a texture.

I found the Lighthouse tutorials to be pretty useful with GLSL, and
particularly remember looking at them to understand attribute variables.

http://www.lighthouse3d.com/opengl/glsl/index.php?intro

pelado

On Mon, Jan 19, 2009 at 6:02 AM, Nicholas C. Raftis III <
Dynamicell@hotmail.com> wrote:

>
> the ambiant occlusion shader seems to be working, but everthing is blue and
> green, maybe I need to set up some parameter variables or something. Here
> goes nothing
>
>
> ALso the shaders ahoy is still above my head, they are nicely commented,
> but its gonna take me a bit to really get whats going on with all the
> different texcoord + vector math stuff. Thanks though.
> –
> -=ili!ili=- http://www.Axiom-Crux.net -=ili!ili=-
>


January 19, 2009 | 4:21 pm

Hehe, thanks thats funny A bunch of the pages on this lighthouse site are marked as though ive been there before, I must have stumbled across it a long time ago before I was ready to really read it. This looks like the ticket though, Ill check it out.

I did send the parameter dump message into the amb.occ shader but it printed in the max window that there were no params, Ill try the shader parameter patch you mentioned.

Thanks again :D


January 19, 2009 | 4:51 pm

I started trying to convert the chromatic ab. shader from the opengl lib, I think its almost correct, but I remember reading in an old post that there is something about the cube mapping that has to be done with a jitter object. heres the copy of my attempt of conversion, does anyone have a working one that I can try out? From what I had read in that post it seemed like several people have converted this one but didn’t post it.. Im going to look for the thread now.


January 19, 2009 | 6:47 pm

there were some fundamental problems with your shader. you had the vertex program tagged as a fragment program and vice versa. you also tried to bind parameters to type varying. you can only bind to type uniform.

imho, it’s impossible to understand shaders unless you start at the very beginning. which means a shader that paints a solid color with a changeable color parameter. then slowly add complexity once you fully understand how it’s working.

for the archives, i’ve attached a fixed version of your shader, with a patch demonstrating how to use cubemaps. pretty straightforward. you can find some good cubemap textures to use at this link:

http://www.ozone3d.net/demos_projects/chromatic_aberration.php

hope it helps.
-rob


January 19, 2009 | 7:46 pm

Hmm thats odd, I guess I second guessed myself on that one, I looked at the versions of the amb occ shader posted on here, and analyzed them compared to the one on the opengl site, and tried to basically do what was done to that one, copying the code from the fragment and vert shaders and in the end I thought I had reversed them so I switched them around, I guess I had them right the first time. As for the variables, thats where I knew I was wrong.

I can tell its going to take a bit to really learn what the heck is going on here, and Im not trying to do things from scratch just yet. The way Ive learned best in the past is to try and modify things other people have made, that’s how I learned jitter and max, but I guess in this case I need to get a more fundamental understanding of how shaders are built before I do that. Once I really get into it, I hope to make slab versions of the AUVI effects, I think that’s something that people would really like.

I guess really more then anything I just want to convert alot of these bad ass shaders that I see on the opengl orange book, and the NVIDEA site, which I think shouldn’t be too hard if I just understand the difference in variables and whatnot, as you had mentioned. Seeing the difference in my wrong conversion and your correct one helps me a ton, this way I can compare and contrast where I went wrong and through trial and error start to understand whats going on.

I think this would be something that would be useful to the whole jitter community, as right now the only good shaders ive tried are the ones vade put out on his page, and a few others here and there from a.benson and others on the list. I dont understand why someone hasn’t done this yet actually, convert all the orange book shaders, and other publicly available opengl shaders and make them available to the jitter comunity. For someone who knows what there doing like some people on here do, it seems like it would take less then an hour to do and would be more then worth it. Maybe someone already has and just hasn’t made them available.

I wish I could do realtime shader programming. Thats why I got into jitter and max in the first place, after having done C and the like, It was amazing to enter a platform where I could experiment and do trial and error in realtime, not having to wait for save,compile,run,error,change,etc..

From what I see, I can open the shaders in max as a text file and recompile them, sortof realtime, but it seems to crash when I open them like that sometimes.

At any rate, Ill check the site you mentioned, looks like I have to set up an account. I assume the images that are referenced in this patch you posted are on there? If not Id love to get a zip with the jpgs you used for the cube map, if they are special maps of some sort.


January 20, 2009 | 1:04 am

Oh man I just got those maps and ran the chromatic abb shader and this is amazing!! this is what im talking about! why arent beautiful and useful things like this already available in the jitter community?! It just makes jitter look so much better, it turns it into a formidable visual effects software.

Thank you so much! I look forward to more of these shaders, I hope I can get up to speed in shader programming and get a depth of field, and shadow shader working, and then we will really have some great realtime render possibilites! Then finally I wont look at current videogames and think "hey why the hell cant I do that in jitter"

Thanks again!


February 10, 2009 | 1:28 pm

hi there, any good news about depth of field shader?
michele


March 20, 2010 | 8:11 pm

HI Léo

Here it is.

Attachments:
  1. ab.lumagauss.jxs

Viewing 16 posts - 1 through 16 (of 16 total)