<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>
		<title>Cycling 74  &#187;  Topic: Array of jit.gl.videoplane holding PNGs is very CPU intensive</title>
		<atom:link href="http://cycling74.com/forums/topic/array-of-jit-gl-videoplane-holding-pngs-is-very-cpu-intensive/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/array-of-jit-gl-videoplane-holding-pngs-is-very-cpu-intensive/feed</link>
		<description></description>
		<pubDate>Tue, 18 Jun 2013 21:44:30 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/array-of-jit-gl-videoplane-holding-pngs-is-very-cpu-intensive/#post-66624</guid>
					<title><![CDATA[Array of jit.gl.videoplane holding PNGs is very CPU intensive]]></title>
					<link>http://cycling74.com/forums/topic/array-of-jit-gl-videoplane-holding-pngs-is-very-cpu-intensive/#post-66624</link>
					<pubDate>Wed, 20 Feb 2013 14:20:35 +0000</pubDate>
					<dc:creator>Andrew</dc:creator>

					<description>
						<![CDATA[
						<p>I&#8217;m working on project that will string together on-the-fly user-drawn transparent PNGs in a turning spiral. There&#8217;ll be lots of drawings (like 100 or more) at any given time, ie 100 videoplanes. Even a very small number of videoplanes max&#8217;s out the Max thread making Max sluggish.</p>
<p>I&#8217;m only banging the movies once to load them into the videoplane. The images are small, < =2K, 600x100. Even if i don't load the images and just put up the empty videoplanes it slays the processor. (late-2011 Macbook Pro and 12-core XEON Mac Pro).</p>
</p><p>Based on the ability to place 150+ videoplanes showing my webcam (jit.gl.grab) in another patcher (can&#8217;t find the post, now, but it is a &#8216;time machine&#8217; of randomly placed videoplanes) I thought this would work no problem, but I&#8217;m really struggling. </p>
<p>I tried Slabs outside of javascript with just 4 videoplanes and it didn&#8217;t make an appreciable difference. Since I&#8217;m not play a movie, I&#8217;m not sure it would anyway.</p>
<p>Here&#8217;s the javascript I&#8217;m using to load the array. Is there anything I can do to make this perform better?</p>
<pre><code>function initSpiral() {
	for (i=0; i<drawing_count ; i++) {
		vplane[i] = new JitterObject("jit.gl.videoplane",CONTEXT_NAME);
		vplane[i].layer=1;
		vplane[i].blend_enable=1;
		vplane[i].depth_enable=0;
		vplane[i].dim=[DRAWING_DIMX/2, DRAWING_DIMY/2]
		vplane[i].scale = [.6, .84, 1.];

			// current drawing placement and incrementing for next
			POS_Z+=INC_Z;
			CURR_ANGLE+=INC_ANGLE;
			ROT_Z=CURR_ANGLE-90;
			POS_X=RADIUS*Math.cos(DegToRad(CURR_ANGLE));
			POS_Y=RADIUS*Math.sin(DegToRad(CURR_ANGLE));

		vplane[i].position=[POS_X, POS_Y, POS_Z];
		vplane[i].rotatexyz=[ROT_X, ROT_Y, ROT_Z];
		vplane[i].colormode="argb";

		png_matrix[i]= new JitterMatrix(4,"char",DRAWING_DIMX/2,DRAWING_DIMY/2);
//post("X, Y, Z, Cur_Ang, Rot_Z",POS_X,POS_Y, POS_Z,CURR_ANGLE,ROT_Z,"n");

		// cycling through short list of drawings for now.
		pngqt.read(png_file[j]); //use one jit.qt.movie object to load all the matrices
		j+=1;
		if (j>(png_file.length-1)) { j=0; }

		pngqt.matrixcalc(png_matrix[i],png_matrix[i]);
		vplane[i].jit_matrix(png_matrix[i].name);
	}
}</drawing_count></code></pre><p>I&#8217;ll also attach the patcher, javascript and PNGs to see it in context. It&#8217;s stripped down &#8211; it doesn&#8217;t have the drawing part, rather this one just loads 7 drawings over and over to fill the array for now.</p>
<p>The number of drawings to use is set in the javascript. I lowered it to 10 for the moment, but it needs to be at more like 100+</p>
<pre><code>DRAWING_COUNT=10;</code></pre><p>I had tried texturing jit.gl.gridshapes a while back, but was having trouble with the transparency I think. It seemed like videoplanes were the way to go, but maybe not?</p>
<p>Thanks for any help!<br />
Andrew</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/array-of-jit-gl-videoplane-holding-pngs-is-very-cpu-intensive/#post-239779</guid>
					<title><![CDATA[Re: Array of jit.gl.videoplane holding PNGs is very CPU intensive]]></title>
					<link>http://cycling74.com/forums/topic/array-of-jit-gl-videoplane-holding-pngs-is-very-cpu-intensive/#post-239779</link>
					<pubDate>Wed, 20 Feb 2013 16:41:23 +0000</pubDate>
					<dc:creator>Rob Ramirez</dc:creator>

					<description>
						<![CDATA[
						<p>hi andrew.<br />
your slowdowns are all the result of setting the dim attribute of your jit.gl.videoplane, both in the javascript, and the big videoplane in your main patcher.<br />
the dim attribute for gl objects is not related to the resolution of the matrix or texture input, but instead refers to the geometry.</p>
<p>simply leave the dim attributes on the gl.videoplanes to their default values, and your patch performs fine over here.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/array-of-jit-gl-videoplane-holding-pngs-is-very-cpu-intensive/#post-239780</guid>
					<title><![CDATA[Re: Array of jit.gl.videoplane holding PNGs is very CPU intensive]]></title>
					<link>http://cycling74.com/forums/topic/array-of-jit-gl-videoplane-holding-pngs-is-very-cpu-intensive/#post-239780</link>
					<pubDate>Wed, 20 Feb 2013 21:16:11 +0000</pubDate>
					<dc:creator>Andrew</dc:creator>

					<description>
						<![CDATA[
						<p>Wow! Thanks so much. I never bothered looking at the dim attribute because it&#8217;s the one thing I thought I DID understand. </p>
<p>Thanks again!</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

