Gabor phase

Sorry if this has been covered somewhere in a previous topic--I searched but couldn't find it. As far as I understand from the CreateProceduralGabor documentation, phase = 0 should correspond to a maximum or minimum (not sure which) at centre of texture. But I am getting neither--the grating is asymmetric within the texture. I can send screenshots if needed but thought there might be a quick answer before I do...

The reference is ProceduralGaborDemo.m There you see a Matlab implementation of the Gabor, and the procedural shader does the same thing. ProceduralGaborDemo(2) runs a verification of the shader against the Matlab code to spot differences and report on accuracy.

One catch: "phase" for the Matlab code ~ "180 - phase" in the DrawTexture command. I don't remember why we had this difference. But in the end a phase == 0 ends up in the Gabors center with a sin(0) in Matlab and a sin(pi) in the shader, which is == 0 for the sine component.

-mario
Thanks, that makes perfect sense. There's a line in the CreateProceduralGabor help text that seems to suggest that there should be either a minimum or a maximum at the centre of the patch (lines 70, 71 at least in my file), so I think I got stuck on that. I'm probably reading that line wrong, though.

You've also answered another question I had about why it doesn't look right--the blend factors. (They're in my larger code for another stimulus, but I can work around.) Thanks!