Question about auxParameters in Screen('DrawTexture') in DriftDemo6

Hi Mario,
I have a question about DriftDemo6 in psychDemos. It uses "Screen('DrawTexture', w, gratingtex1, srcRect, [], angle, [], [], [], [], [], [ 0,yoffset,0,0])" to draw the previously defined grating, I'm confused about how to use the auxparameters, I can't find a demo or function descrbing how to use it in detail.It seems that here "yoffset" means how many pixels the grating will drift in verticle direction. If the first parameter means pixels drifting in horizontal, then what does the third and fourth parameter mean?
In ExpandingRingsDemo auxparameters are defined in "ExpandingRingsShader.frag.txt",but I just can't find one file to define the one in DriftDemo6.
Can you take a little time answering my question? Thanks a lot.
Take some time to look at the demos. The aux parameters are explained in the demos very clearly.

For example, from memory, procedural gaborium demo spells out exactly what they are.

You should be able to find all you need if you take some time to look at the help text and comments in these demos.

Peter

--- In psychtoolbox@yahoogroups.com, "gaoy0525" <gaoy0525@...> wrote:
>
> Hi Mario,
> I have a question about DriftDemo6 in psychDemos. It uses "Screen('DrawTexture', w, gratingtex1, srcRect, [], angle, [], [], [], [], [], [ 0,yoffset,0,0])" to draw the previously defined grating, I'm confused about how to use the auxparameters, I can't find a demo or function descrbing how to use it in detail.It seems that here "yoffset" means how many pixels the grating will drift in verticle direction. If the first parameter means pixels drifting in horizontal, then what does the third and fourth parameter mean?
> In ExpandingRingsDemo auxparameters are defined in "ExpandingRingsShader.frag.txt",but I just can't find one file to define the one in DriftDemo6.
> Can you take a little time answering my question? Thanks a lot.
>
"help ProceduralShadingAPI" will provide you with info about how parameters are passed from Screen('DrawTexture(s)') to a shader.

You can see that if the shader defines certain variables (attribute), they will receive the DrawTexture parameters. And that aux parameters always have to come im multiples of 4, even if you have to pad your call arguments with some zeros at the end to make it fit. This is for efficiency reasons in parameter passing.

Each demo prints the path/file of the shader source files it loads, so you can look at those files for inspiration.

-mario

--- In psychtoolbox@yahoogroups.com, Gao Y <gaoy0525@...> wrote:
>
>
> Thanks, Peter. Now I know that the aux parameters can be predefined in the demo and can be passed to the openGL shader. I think what confuses me now is how to define the shader in C, I'll take time studying it.
>
>
> ________________________________
> From: peter.scarfe <peter.scarfe@...>
> To: psychtoolbox@yahoogroups.com
> Sent: Friday, August 9, 2013 3:24 PM
> Subject: [psychtoolbox] Re: Question about auxParameters in Screen('DrawTexture') in DriftDemo6
>
>
>
> Â
>
>
>
> Take some time to look at the demos. The aux parameters are explained in the demos very clearly.
>
> For example, from memory, procedural gaborium demo spells out exactly what they are.
>
> You should be able to find all you need if you take some time to look at the help text and comments in these demos.
>
> Peter
>
> --- In mailto:psychtoolbox%40yahoogroups.com, "gaoy0525" <gaoy0525@> wrote:
> >
> > Hi Mario,
> > I have a question about DriftDemo6 in psychDemos. It uses "Screen('DrawTexture', w, gratingtex1, srcRect, [], angle, [], [], [], [], [], [ 0,yoffset,0,0])" to draw the previously defined grating, I'm confused about how to use the auxparameters, I can't find a demo or function descrbing how to use it in detail.It seems that here "yoffset" means how many pixels the grating will drift in verticle direction. If the first parameter means pixels drifting in horizontal, then what does the third and fourth parameter mean?
> > In ExpandingRingsDemo auxparameters are defined in "ExpandingRingsShader.frag.txt",but I just can't find one file to define the one in DriftDemo6.
> > Can you take a little time answering my question? Thanks a lot.
> >
>