am I choking my graphics card with too many shaders?

Ted Wiggin's icon

hi

im just starting to venture into the world of gl objects, and I've been using my normal matrix processing modus operandi, which is basically just making big webs of effects modules and combining them with matrix operators. i make chains of slab objects with the same name containing whatever different shaders, then run them all through one another and into a videoplane.

i only seem to be able to get about three shaders before I start getting apparently random solid colors

is there any inherent limitation on how many different shaders you can work with at a time in max? im working on a low end macbook with an integrated graphics card. could I be choking it with too many shaders?

if so, would learning to write my own shaders so I can combine effects and perameters into a single object solve this problem?

Ted Wiggin's icon

the error message I get is
git.gl.pbuffer: error binding texture: GL Error: Invalid operation
git.gl.texture: unable to create texture!

Ted Wiggin's icon

hjklsadf by restarting the patch ive gotten away with adding a few more shaders!

i suppose my question still stands though. Is this just not how youre supposed to do it?

Rob Ramirez's icon

> is there any inherent limitation on how many different shaders you can work with at a time in max?

not in max, all depends on your card.

> im working on a low end macbook with an integrated graphics card. could I be choking it with too many shaders?

those are definitely not the best cards for 3d graphics.

> if so, would learning to write my own shaders so I can combine effects and perameters into a single object solve this problem?

possibly, but depends on what you're trying to do. some effects are impossible to achieve without chaining shaders.
obviously the more you know about shaders, the better off you'll be.

unfortunately, the best advice i can give is to work with a better graphics card.

Dg's icon

> a better graphics card

do you have any hint?

Rob Ramirez's icon

Quote: Kyred wrote on Sun, 25 January 2009 03:41
----------------------------------------------------
> > a better graphics card
>
> do you have any hint?
----------------------------------------------------

Gewalter Benjamin's icon

one of the biggest problems with macbooks is that it isn't "possible" to upgrade the graphics card.

Ted Wiggin's icon

thanks a lot for your response. thats frustrating but its good to know

however I have been getting some somewhat interesting gpu clitches

laserpilot's icon

i am also having this problem on a 2 year old macbook pro..if i try to chain more than 3 shaders together, i get an all white image, which goes away if I turn one other shader off (doesnt matter which one..if i have 5 on and turn off any of them, the image comes back)..nothing fancy, just scalebias, sobel, brcosa and normal..annoying because I'm trying to rebuild my vj patch in gl but i normally have a few cases where i need tons of effects on at once

Rob Ramirez's icon

please post a patch demonstrating this behavior with specific system and software specifications, and we will do our best to track down problems.

laserpilot's icon

here is my embarassing looking patch in the prototyping stage..im using the video processing tutorial from the main page as a jumping off point ..i put some notes in there to walk you though how it works..just turn the effects on with the ubu menus and when i reach the magic number, my screen goes white

system: 17" macbook pro 2.16ghz
2gb ram
ati radeon x 1600 with 256mb vram
using mac os x 10.5.6
latest version of max, 5.0.5

Max Patch
Copy patch and select New From Clipboard in Max.

laserpilot's icon

here is my embarassing patch in the prototyping stage using the video processing tutorial from the main page as a starting point..i added some comments as to how to get the thing running..when i have 4 total shaders on at once (there is one hidden in the 'end of video chain' patch, my window goes white

system: 17" macbook pro 2.16 ghz
2gb ram
ati radeon x 1600 ith 256mb vram

os: 10.5.6
max: 5.0.5 (latest)
quicktime: whatever the latest update was a week or two ago.. 7.6.2 or whatever

Max Patch
Copy patch and select New From Clipboard in Max.

laserpilot's icon

sorry..double post and couldnt edit it

Joshua Kit Clayton's icon

I think your issue is the nested @dimscale 2 1, which should only be
used on the first uyvy2rgba slab. The dimensions keep growing by
powers of two until the graphics card can't support the resolution.

-Joshua

laserpilot's icon

ah..thank you so much..that was exactly it..thats what i get for blindly copying and pasting..now to really see what my shader limit is, hah

Ted Wiggin's icon

ive encountered a new problem that i think is probably related to my crappy graphics card. td.rota.jxs simply does not work on my machine. I get black.

does anyone know of any other shaders or combinations of shaders that would allow me to scale and rotate an image around a variable axis? its so hard to make attractive feedback loops without it

Ted Wiggin's icon

td.kaleido also doesnt work although that's less important

jasch's icon

this has been reported and an alternative rota shader has been posted
for older/weaker graphics cards. search the forums.

/*j

> td.rota.jxs simply does not work on my machine. I get black.

Ted Wiggin's icon

are you referring to the one posted in this thread?

I had trouble with that one as well. i get this error message
jit_xml_documentL error reading file at byte offset 3862 / not well-formed (invalid token)
line (137): >
jit.gl.shader: error reading shader xml file...

Joshua Kit Clayton's icon

XML was munged by the forum, I suppose. Here's a zip file uploaded in the forum.

-Joshua

Ted Wiggin's icon

goddamnit, no dice. there are two underscores after the final that it seems to want me to get rid of but when I do, it gives me "ERROR: Parser found no code to compile in source strings."

sorry about all this and thankyou so much for your help

Ted Wiggin's icon

I'm just trying to get a textured plane to appear on screen. can anyone tell me what I'm doing wrong? I've attached the nonfunctioning patch

Ted Wiggin's icon

this is part of a larger problem I'm trying to solve. I have a particle system based on the one from particle sprites in recipe book 1 and I want to get more than one type of sprite to appear in the system at the same time. I figure if I can get it to load more than one texture, I can either switch between them as it iterates through the particles, or generate two or more systems with different textures and composite them. ive included that patch too, if anyone has any suggestions on how best to do that I'd love to hear them

Rob Ramirez's icon

for the smaller problem you need to turn automatic on, and set your dim to a larger value in the gridshape.

for the larger problem, not sure if i understand, but you can capture to texture with an alpha value, and composite these textures over each other.

Ted Wiggin's icon

ah thankyou a lot!

thanks to your smaller solution, I've made this patch that seems to me like it ought to solve the bigger broblem. It doesn't work though and I don't know why

i have two separate particle systems on two separate renderers in two separate windows. both work fine by themselves. It seemed to me like I ought to be able to combine them by switching the "drawto" attribute on one of the gl.gridshape objects to the name of the other gridshape object.

to operate the patch, open it, click the only saved preset, load different images into the two gl.texture objects (im using transparent .tiffs) and load a .wav file into the sfplay~ object. The particles should jitter around in their separate windows according to the amplitude of the sound.

now switch the destination of the "dok" gridshape object to "flicker". If your computer is having the same issue as mine, you should see a second system of white square particles bouncing along with the properly textured particles in the "flicker" window

if at this point you switch the destination of the "dok" texture object to "flicker", you see a single instance of your second texture bouncing along with a full system of your first texture. this is the closest I've been able to get to what I want but really I'd like to see the two full particle systems running in the same window. (interestingly, when I have my windows in expose mode [im on a mac], I can see the window flickering back and forth between the two systems. this tells me that it's rendering the complete second system, it's just not displaying it. could this be a timing issue?)

should I be going at this by a different approach?

Rob Ramirez's icon

you need to send the drawto message to both the gl.gridshape and the gl.texture.

Ted Wiggin's icon

yeah, I've tried that, it still gets me just a single instance of one particle on top of a full set of the other particle

I managed to solve the problem using the name attribute for the jit.gl.texture object. I loaded three .tiffs into three texture objects with different names. then, using a new plane I added to the matrix that determines XYZ coordinates for each particle, I had the gridshape object switch between the shaders as it jit.iterates through the particles. I included the fixed patch for anyone who's interested