Changing slabs

Jul 11, 2006 at 8:09pm

Changing slabs

I am trying to seemlessly switch between slabs somehow, but unfortunately having little success right now. Changing the shader by sending a read command creates a pause and makes no sense since I want shaders choosen and compiled before hand. I have realized that just creating slabs will slow down the system whether or not information is sent to them so arraying them in a poly~ does not work out well. I have tried using one slab and then sending individual shaders to it. However each time the slab encounters a new shader there is a pause while I guess it compiles the shader?! After the first encounter the slab will immediately load up a shader if it is sent to it consequent times. How can I get this wrking properly?

I guess I could make my own slab building a plane myself and using ortho 2 and capture or something like that (do not have access to the docs right now) to render the results by texture but that really would feel redundant. Does anyone have any suggestions how I solve my woes?

Thanks!

PS. Using Jitter 1.5 on a windows laptop with a radeon 9700 mobile.

#26761
Jul 11, 2006 at 8:21pm

On Jul 11, 2006, at 1:09 PM, Sebastian wrote:

>
> I am trying to seemlessly switch between slabs somehow, but
> unfortunately having little success right now. Changing the shader
> by sending a read command creates a pause and makes no sense since
> I want shaders choosen and compiled before hand. I have realized
> that just creating slabs will slow down the system whether or not
> information is sent to them so arraying them in a poly~ does not
> work out well. I have tried using one slab and then sending
> individual shaders to it. However each time the slab encounters a
> new shader there is a pause while I guess it compiles the shader?!
> After the first encounter the slab will immediately load up a
> shader if it is sent to it consequent times. How can I get this
> wrking properly?

This should only be expensive on cards/OS which needs to use Cg to
compile the GLSL. As of 10.4.3 or later or on PC where supported the
driver is used to compile the GLSL and is much faster. If you’re
still using the former however, I would recommend just loading all
shaders you want into slab at patch launch (a slab has to be run once
for the shader to actually compile). Once compiled, they are cached
for future use.

In Jitter 1.6, and the forthcoming CFM 1.5.3, jit.gl.slabs which are
not in use no longer pose a performance penalty.

Lastly, by using explicit full paths for shaders (or any files for
that matter), you can avoid any search path related pauses, which
might also be part of your problem.

-Joshua

#80415
Jul 11, 2006 at 8:31pm

Thanks for the fast reply!

I guess I could cope with limiting myself to a choice of 16 shaders in one part of my patch choosen on start. I do not really need to load them in while everything is running. However, do you know how soon it will be until Jitter 1.6 is released for Windows. I already see the betas up for Mac. And sorry, what exactly is CFM? I am very new to Max in general…

#80416
Jul 11, 2006 at 8:57pm

On Jul 11, 2006, at 1:31 PM, Sebastian wrote:

> However, do you know how soon it will be until Jitter 1.6 is
> released for Windows. I already see the betas up for Mac.

Mac Universal Binary is our first priority for Jitter 1.6 since this
update is required for MacTel users to run Max and Jitter natively,
after we sort out the Mac UB version, we’ll be getting the Windows
Jitter 1.6 and MaxMSP 4.6 versions ready. So sometime later this summer.

> And sorry, what exactly is CFM? I am very new to Max in general…

MaxMSP 4.5.7, Jitter 1.5.x and earlier use the older Macintosh CFM/
PEF executable format.

-Joshua

#80417
Jul 12, 2006 at 3:15pm

Thanks for the information on the upcoming releases!

Anyway, I switched method. I have the one slab and a poly~ of shaders, all differently named. I switch between shaders by sending the slab a message ‘shader ‘. This works as it should but with one flaw… the slab then only outputs to an area half the width and height in the top left corner. When I send the slab a message to remove the shader used, then the slab renders to the correct area. This should not be a problem with my shaders because they work correctly if read directly into the slab. Am I going wrong somewhere?

#80418
Jul 28, 2006 at 6:51pm

Here is an example of this…

max v2;
#N vpatcher 11 123 486 547;
#P origin 0 9;
#P window setfont “Sans Serif” 9.;
#P message 212 214 59 9109513 shader none;
#P message 165 191 54 9109513 shader sh2;
#P window linecount 2;
#P newex 126 99 129 9109513 jit.gl.shader GPU @name sh2 @file op.mult.jxs;
#P window linecount 1;
#P message 165 175 54 9109513 shader sh1;
#P window linecount 2;
#P newex 126 70 129 9109513 jit.gl.shader GPU @name sh1 @file op.add.jxs;
#P window linecount 1;
#P newex 126 249 68 9109513 jit.gl.slab GPU;
#P newex 126 279 190 9109513 jit.gl.videoplane GPU @scale 1.333 1. 1.;
#P newex 126 143 120 9109513 jit.noise 4 char 640 480;
#P toggle 64 275 15 0;
#P message 64 293 45 9109513 sync $1;
#P newex 64 321 149 9109513 jit.window GPU @size 640 480;
#P user jit.fpsgui 62 195 60 9109513 0;
#P toggle 40 50 15 0;
#P newex 40 76 50 9109513 qmetro 2;
#P newex 40 144 55 9109513 t b b erase;
#P newex 40 349 129 9109513 jit.gl.render GPU @ortho 2;
#P window linecount 2;
#P comment 218 179 200 9109513 When I choose a shader the slab just renders to a rectangle in the top-left part of the window;
#P comment 212 230 148 9109513 When there is no shader , the slab outputs to the correct dimensions;
#P window linecount 1;
#P comment 128 56 120 9109513 Some ordinary shaders…;
#P connect 6 0 5 0;
#P connect 5 0 4 0;
#P connect 4 0 3 0;
#P fasten 4 2 3 0 89 180 45 180;
#P connect 4 1 7 0;
#P connect 10 0 9 0;
#P fasten 9 0 8 0 69 316 69 316;
#P connect 5 0 11 0;
#P connect 11 0 13 0;
#P hidden connect 17 0 13 0;
#P hidden connect 15 0 13 0;
#P hidden connect 18 0 13 0;
#P connect 13 0 12 0;
#P connect 11 0 13 1;
#P pop;

#80419
Jul 28, 2006 at 9:06pm

On Jul 28, 2006, at 11:51 AM, Sebastian wrote:

>
> Here is an example of this…When I choose a shader the slab just
> renders to a rectangle in the top-left part of the window;
> When there is no shader , the slab outputs to the correct dimensions;

This seems to work fine in 1.6b5 UB. Will verify that this is broken
under 1.5.2 XP and working for the forthcoming version of 1.6 XP.

Sorry for the nuisance. WIll let you know what we find.

-Joshua

#80420

You must be logged in to reply to this topic.