Hello. I have a simple GLSL alphablending shader I am attempting to
port to CIKernel for kicks/learning experience. The following is the
original GLSL (fragment shader only cause its all that is interesting);
Of course, this works if all the input image sizes are equal. It does
not mirror the GLSL output if they differ. Now I understand that Core
Image does lazy evaluation and uses the DOD/ROI to optimize the pixels
it actually needs. My attempt after reading some posts to edit the
filter function results in this non functional code: (it renders the
same as before, nesting smaller images/masks within the larger image.
function v001ROIHandler(samplerIndex, dstRect, info)
{
return info;
}
// set ROI handler
v001AlphaBlend.ROIHandler = v001ROIHandler;
function __image main(__image image1, __image image2, __image mask)
{
// input image sizes - get largest width/height.
var maxwidth = (image1.extent.width >= image2.extent.width) ?
image1.extent.width : image2.extent.width;
maxwidth = (maxwidth > mask.extent.width) ? maxwidth :
mask.extent.width;
Also, is there an example of using AffineTransform in lieu of mat4
rotation/translation matrices withing a CIKernel? Can I use an affine
transform within the kernel itself, or must I break out operations
within the 'filter function' and apply transforms 'between' sampling
operations? I have some other more interesting shaders which use mat4
matrices which I cannot port straightforwardly.
Curious, and eager to get my GLSL shaders working in CI.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/email@hidden