It doesn't sound like something that would cause a shortage of VRAM. And I'd expect the same behavior in QC if it was that. QC manages the openGL side for you, I don't think there's a way to release textures and the like beyond making sure they're not stored somewhere in QC itself.
One thing you might want to try: write out the time taken for each iteration, instead of writing out the max/min/average at the end. I'm thinking the first frame might be slow as QC generates textures and sets everything up, and this will give you a high max value that doesn't really matter. You could log only high values for convenience. You can check against activity viewer too, see what's happening in the system when it slows down. Chris On 29 October 2010 10:43, Rua Haszard Morris <[email protected]> wrote: > >It's worth also checking how long each .qtz takes to render. Perhaps take > a look > > > >in the opengl monitor to see how much vram is being used, if it's reaching > a > >point where it's out of vram and has to swap a lot of textures in and out > that > >might cause an occasional slow frame. > That sounds promising - just launched OpenGL Driver Monitor and OpenGL > Profiler > to investigate.. looks like I'll have to learn how to get the most from > these > tools (I couldn't get OpenGL Profiler to attach to the process). > > If there is some VRAM usage problem, how would I go about working around > it? Can > I tell OpenGL to throw away buffers? > > >What are the compositions doing? Can you dump them all into QC and see if > it > >works ok there? > The transition is dissolve, and the input transitions are doing some text > rendering and a few billboards - I chose these 2 as easy, fast test cases. > In > Quartz Composer the whole shebang runs nicely full screen. > > Thanks for the help. > Rua HM > > >On 29 October 2010 09:10, Rua Haszard Morris <[email protected]> wrote: > > > >I'm trying to use a transition patch to transition between the output of > two > >>other animations. The problem I'm having is that sometimes this is not > >rendering > >>fast enough to be rendered in real time. It seems that rendering a frame > of > the > >>transition qtz occasionally balloons out to 1.5 s. > >> > >>I've written a test loop to investigate what's happening, and it seems > that > >>every 9 or so seconds, the render takes a second or more, as opposed to > the > >>usual <0.05 s. > >> > >>What should I do to optimise the rendering of these animations? I'd like > to be > >>able to render full screen (i.e. 1280x720+) and in real time, e.g. at > frame > >>rates of 30 (ideally 60) per second. I'm sure this must be possible with > >Quartz! > >> > >>Here's the (quick & dirty!) test code. Tests were run on a 2.4 GHz > MacBook > Core > >>2 Duo with 2 GB. > >> > >> > >> NSString* inputQtz1 = [[NSBundlemainBundle] > >>pathForResource:@"InputA"ofType:@"qtz"]; > >> NSString* inputQtz2 = [[NSBundlemainBundle] > >>pathForResource:@"InputB"ofType:@"qtz"]; > >> NSString* mixQtz = [[NSBundlemainBundle] > >>pathForResource:@"Dissolve"ofType:@"qtz"]; > >> > >> // open qtzs > >> QCComposition* qtz1 = [QCComposition compositionWithFile:inputQtz1]; > >> QCComposition* qtz2 = [QCComposition compositionWithFile:inputQtz2]; > >> QCComposition* qtzmix = [QCCompositioncompositionWithFile:mixQtz]; > >> > >> // args > >> NSDictionary* transitiond = [NSDictionarydictionaryWithObjectsAndKeys: > >> QCCompositionInputPreviewModeKey, [NSNumbernumberWithBool:YES], > >> NULL > >> ]; > >> > >> // set up renderer(s) > >> CGColorSpaceRefco = > CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); > >> QCRenderer* renderer1 = [[QCRendereralloc] > >>initOffScreenWithSize:NSMakeSize(1280, 720) colorSpace:co > composition:qtz1]; > >> QCRenderer* renderer2 = [[QCRendereralloc] > >>initOffScreenWithSize:NSMakeSize(1280, 720) colorSpace:co > composition:qtz2]; > >> QCRenderer* renderer3 = [[QCRendereralloc] > >>initOffScreenWithSize:NSMakeSize(1280, 720) colorSpace:co > composition:qtzmix]; > >> > >> // now render a frame at a time for a while and see how long it takes > >> double tmp, max=std::numeric_limits<double>::min(), > >>min=std::numeric_limits<double>::max(), total; > >> int count = 0; > >> NSTimeIntervalelapsed = [NSDatetimeIntervalSinceReferenceDate]; > >> for (NSTimeInterval time=0; time<60; time+=1.0/60.0) > >> { > >> NSAutoreleasePool* pool2 = [NSAutoreleasePoolnew]; > >> > >> elapsed = [NSDatetimeIntervalSinceReferenceDate]; > >> [renderer1 renderAtTime:time arguments:nil]; > >> [renderer2 renderAtTime:time arguments:nil]; > >> [renderer3 renderAtTime:time arguments:transitiond]; > >> > >> tmp = ([NSDatetimeIntervalSinceReferenceDate]-elapsed); > >> std::cerr << "render " << time << " took " << tmp << std::endl; > >> elapsed = [NSDatetimeIntervalSinceReferenceDate]; > >> count++; > >> > >> [pool2 release]; > >> > >> if (tmp < min) > >> min = tmp; > >> if (tmp > max) > >> max = tmp; > >> total += tmp; > >> } > >> > >> std::cerr << "min " << min << std::endl; > >> std::cerr << "max " << max << std::endl; > >> std::cerr << "total " << total << std::endl; > >> std::cerr << "average " << total/count << std::endl; > >>Thanks in advance - I'm sure there's something obvious I'm not doing that > would > >>speed this up.. > >>Rua HM. > >> > >>-- > >>http://cartoonbeats.com > >>http://haszaristwocents.blogspot.com > >>http://myspace.com/haszari > >>http://last.fm/music/Haszari > >> > >> > >> > >> > >> _______________________________________________ > >>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/psonice%40gmail.com > >> > >>This email sent to [email protected] > >> > > > > > >
_______________________________________________ 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]

