On Jan 20, 2011, at 5:44 PM, Christopher Wright wrote:
>>> It only displays the center because the GLSL Grid's size is too big -- it
>>> should be 2 wide at most, and it looks to be 3 and a fraction. The Width
>>> and Height inputs control this, so you can see which patches control this
>>> (Image Dimensions, I think)
>>
>> But isn't that the sort of thing that Image Dimensions is supposed to be
>> for? Even when I set it to 1 or 2 manually, the center cut behavior does not
>> change.
>
> I haven't looked closer, but if the grid is less than 2 across and
> AspectRatio high, it should fit on screen unless something else is changing
> it (perhaps its set closer to the camera or something?)
I'm not certain at this point, but as I expect to do further processing and it
does show the entire image in the Render In Image, I stopped chasing this one.
Thank you.
>>> Render In Image probably needs a clear patch. If that doesn't help, please
>>> post a sample composition that shows the problem you're encountering.
>>
>> Well, when I add a clear patch, if I enable it, it goes black, if I then
>> disable it, things are fine. Until I change something like the input image,
>> etc... then I need to manually clear it to black, then disable it.
>
> it went black because the clear patch was layer 2 -- set it to 1 (so it
> clears first, then draws other stuff) and you should be good to go. The
> layer number is the number in the corner of the patch.
That did it, thanks.
> ...snip...
> In fact, the above could be even simpler:
>
> pixelColor can go away, and the vertex shader can set gl_FrontColor to
> glColor * texture2DRect(texture, gl_TexCoord[0].xy). Then the fragment
> shader is simply "gl_FragColor = gl_Color;". no per-pixel math at all.
>
> The way GL works is that you specify vertices (the triangle corners), and
> various attributes at those vertices (colors, normals, texture coordinates,
> whatever), and the pixels in the middle get in-the-middle values
> automatically. It's just part of the contract that when you specify those
> per-vertex, the fragment shader gets interpolated values as it walks across
> the triangle. You don't need to ask it to do that, because that's what it's
> built to do automatically. (very anticlimactic, I know)
So - this instead? Vertex:
uniform sampler2DRect texture;
void main()
{
//Transform vertex by modelview and projection matrices
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
//Forward current color and texture coordinates after applying texture
matrix
gl_FrontColor = gl_Color * texture2DRect(texture, gl_TexCoord[0].xy);
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
}
and this Fragment:
void main()
{
gl_FragColor = gl_Color;
}
I'll try it out and let you know. Thanks again.
Patrick
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com
This email sent to [email protected]