Quartz Composer pixel formats and context handling

guitarflow's picture

Hey there guys,

we are trying to implement some sort of pipeline with custom QCPlugins and CIFilters within QC. It all worked out well at first but we ran into problems lately.

The main issue is that we don't know how the CGLContext operates in conjunction with pixel formats. We want that all our components are working on floating point buffers to get the maximum quality possible.

However, we don't understand how Quartz Composer handles the input and output image buffers/textures. It seems that regardless of how we set the output image, it gets scaled down to RGBA 8 bit per component.

So, to phrase a question: is there any way to tell QC that it should use RGBA floating point buffers? Are the input and output images converted to fit the pixel format QC expects?

Maybe someone can shed some light on this! It's really confusing. Especially as Apple is using the word "pixel format" in CGL and QCPlugIn with totally different meanings.

Thanks in advance!!


Obsolete Plugin Cleanup

It would be excellent if there was a little utility app, independent of kinemecore probably (but this wouldn't be bad with kinemecore too), that would go and "cleanup" old plugins like structure tools, directory scanner blocking, spooky, gl tools during the alpha port function era, etc., that have been made obsolete by new plugins/have been lumped in with new plugins. Like, how Kinemecore checks for duplicate versions/older versions of a given plugin, or locations being in the wrong place.

I realize that something like that would have to have a static list of some outdated plugins inside the app and patches that replace them, that would be maintained, and that this could get into a pain. Maybe this would be best as an opensource thing where people could update that list themselves.

The purpose of it's being it's own utility app, script, or whatever, is so that someone wouldn't have to start up QC to do a "plugin management".

The "problem" scenario, is that, if you're loading an app that uses patches like Structure Maker or Directory Scanner Blocking that have been gobbled up by other patches over the years (DataTools, FileTools), and the user has them double installed - like, they have Structure Maker AND DataTools installed, not only does QC have problems on start, but it's pretty darn hard to figure out a way to keep your own app from crashing on start, or not initializing, because of the duplicates.

Maybe there's some eloquent way to handle this in the internals of an app, but I sure haven't found it - and I doubt there is in the case of duplicate plugins, when loading them from user, library, or system locations. I don't necessarily want to stop external loading of QCPatches altogether, but I guess that would be the alternative, to making it so the user doesn't have to jump through as many hoops. It just keeps them from using QCPatches installed on their system though (like QB does currently), which is sometimes not an advantage.

Bullet 'Hello World' example

pascal's picture

I've just put together a sort of "Hello World" example of using the Bullet game physics engine in a QCPlugin :

The folder contains : - a QCPlugin : tLBulletHelloWorld.plugin - a QCComposition : tLBuller_HelloWorld_b1.1.qtz - the related XCode project ( with all Frameworks , and sources included )

To start a project from the scratch you'll need to :
- copy the bullet-2.78/src in your project directory ( and include this in the project search paths ) - import/link the bullet frameworks ( from the Frameworks folder in the Xcode sample project ) .

Voila , sure there might be smarter ways to do it ..just thought this could interesting .



Virtual input and output

Pyroh's picture

I'm trying to code custom patches for Quartz Composer. I think I may have understand how it works (I'm new to Obj-C but I know programmation basis and used several programming language such as C or C#).

It remains one problem : for the 1st patch I'm trying to code I need 2 inputs and 1 output, one of the input is a BOOL, the remaining input and the output must be virtual. The patch is intended to emit the input value to the output if the BOOL input is set to true. So I made this in the .h file:

@property BOOL inputEmit;
@property (assign) id inputValue;
@property (assign) id outputValue;

Of course I tried to put this in the .m file :

@dynamic inputValue, outputValue;
/* Or */
@synthesise inputValue, outputValue;

Compilation works with few warnings complaining about inputEmit. When I test the patch in QC there's only inputEmit which is available, inputValue and outputValue simply disappeared.

Obviously I'm doing it wrong. What did I miss ? I also tried NSObject instead of id for the datatype but it doesn't work...

Every help will be much appreciated :)