<?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: sketch drawobject() efficiency</title>
		<atom:link href="http://cycling74.com/forums/topic/sketch-drawobject-efficiency/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/sketch-drawobject-efficiency/feed</link>
		<description></description>
		<pubDate>Wed, 19 Jun 2013 02:25:37 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/sketch-drawobject-efficiency/#post-26318</guid>
					<title><![CDATA[sketch drawobject() efficiency]]></title>
					<link>http://cycling74.com/forums/topic/sketch-drawobject-efficiency/#post-26318</link>
					<pubDate>Tue, 06 Jun 2006 14:10:34 +0000</pubDate>
					<dc:creator>Thijs Koerselman</dc:creator>

					<description>
						<![CDATA[
						<p>Hi, I&#8217;m using sketch to draw a number of basic gridshapes and I&#8217;m having<br />
problems with my cpu load rising really fast when I increase the number of<br />
shapes. I can only render about 100 of them at 30fps. I tried to optimize<br />
the code so that every &#8220;draw&#8221; command solely triggers the drawing and<br />
nothing else. The code is listed below. Am I doing something stupid or is<br />
drawobject just not the way to do this?</p>
<p>- thijs</p>
<p>using pentium m1.86 jitter 1.5.2 max 4.5.6 nvidia go6800</p>
<p>
nPhotoContact.prototype.draw = function()<br />
{<br />
    var tmp = new JitterObject(&#8220;jit.hello&#8221;); // trigger garbage collection<br />
to fix memory leak</p>
<p>    with(mysketch)<br />
    {<br />
        reset();<br />
        glmatrixmode(&#8220;modelview&#8221;);<br />
        glloadidentity();<br />
        glulookat(0., 0., 5., 0., 0., 0., 0., 1., 0.);</p>
<p>        this.draw_planes(); // draw objects<br />
        draw(); // draw sketch to context<br />
    }<br />
}</p>
<p>nPhotoContact.prototype.draw_planes = function()<br />
{<br />
    var N = this.m_screencount_x *this.m_screencount_y;<br />
    for(var i=0; i<n ; i++)<br></n>
    {<br />
        mysketch.drawobject(this.m_context+&#8221;.obj_&#8221;+i, 0); // draw<br />
jit.gl.gridshapes<br />
    }<br />
}</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/sketch-drawobject-efficiency/#post-78507</guid>
					<title><![CDATA[Re: sketch drawobject() efficiency]]></title>
					<link>http://cycling74.com/forums/topic/sketch-drawobject-efficiency/#post-78507</link>
					<pubDate>Tue, 06 Jun 2006 17:53:45 +0000</pubDate>
					<dc:creator>Joshua Kit Clayton</dc:creator>

					<description>
						<![CDATA[
						<p>
On Jun 6, 2006, at 7:10 AM, Thijs Koerselman wrote:</p>
<p>> Hi, I&#8217;m using sketch to draw a number of basic gridshapes and I&#8217;m  <br />
> having problems with my cpu load rising really fast when I increase  <br />
> the number of shapes. I can only render about 100 of them at 30fps.  <br />
> I tried to optimize the code so that every &#8220;draw&#8221; command solely  <br />
> triggers the drawing and nothing else. The code is listed below. Am  <br />
> I doing something stupid or is drawobject just not the way to do this?</p>
<p>I would recommend setting the displaylist attribute for the target  <br />
object to draw, and then using the ignore object attributes flag for  <br />
draw object. This should speed things up a bit. Lastly, you might  <br />
want to decrease the number of vertices for each gridshape.</p>
<p>In Jitter 1.5.3/1.6 there are some faster ways coming to render  <br />
multiple objects, general improvements to jit.gl.sketch, and bug  <br />
fixes for multiple objects with displaylist attributes set to true.</p>
<p>-Joshua</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/sketch-drawobject-efficiency/#post-78508</guid>
					<title><![CDATA[Re: sketch drawobject() efficiency]]></title>
					<link>http://cycling74.com/forums/topic/sketch-drawobject-efficiency/#post-78508</link>
					<pubDate>Thu, 08 Jun 2006 18:52:03 +0000</pubDate>
					<dc:creator>Thijs Koerselman</dc:creator>

					<description>
						<![CDATA[
						<p>Thanks Joshua,</p>
<p>deceasing @dim improved the overall performance. I can&#8217;t use the ignore<br />
attributes flag, because every plane has it&#8217;s own texture, and alpha. I&#8217;m<br />
also changing textures, positions and rotation all the time. Sometimes for<br />
every frame, so I guess displaylists are also out of the question.<br />
I&#8217;m glad to hear that 1.5.3 will improve on some of this. Im very much<br />
looking forward to the new updates. I guess it will also be worth porting my<br />
code to Java.</p>
<p>best, -thijs</p>
<p>On 6/6/06, Joshua Kit Clayton <jkc @musork.com> wrote:<br />
><br />
><br />
> On Jun 6, 2006, at 7:10 AM, Thijs Koerselman wrote:<br />
><br />
> > Hi, I&#8217;m using sketch to draw a number of basic gridshapes and I&#8217;m<br />
> > having problems with my cpu load rising really fast when I increase<br />
> > the number of shapes. I can only render about 100 of them at 30fps.<br />
> > I tried to optimize the code so that every &#8220;draw&#8221; command solely<br />
> > triggers the drawing and nothing else. The code is listed below. Am<br />
> > I doing something stupid or is drawobject just not the way to do this?<br />
><br />
> I would recommend setting the displaylist attribute for the target<br />
> object to draw, and then using the ignore object attributes flag for<br />
> draw object. This should speed things up a bit. Lastly, you might<br />
> want to decrease the number of vertices for each gridshape.<br />
><br />
> In Jitter 1.5.3/1.6 there are some faster ways coming to render<br />
> multiple objects, general improvements to jit.gl.sketch, and bug<br />
> fixes for multiple objects with displaylist attributes set to true.<br />
><br />
> -Joshua<br />
><br />
></jkc></p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/sketch-drawobject-efficiency/#post-78509</guid>
					<title><![CDATA[Re: sketch drawobject() efficiency]]></title>
					<link>http://cycling74.com/forums/topic/sketch-drawobject-efficiency/#post-78509</link>
					<pubDate>Thu, 08 Jun 2006 19:03:21 +0000</pubDate>
					<dc:creator>Joshua Kit Clayton</dc:creator>

					<description>
						<![CDATA[
						<p>
On Jun 8, 2006, at 11:52 AM, Thijs Koerselman wrote:</p>
<p>> deceasing @dim improved the overall performance. I can&#8217;t use the  <br />
> ignore attributes flag, because every plane has it&#8217;s own texture,  <br />
> and alpha. I&#8217;m also changing textures, positions and rotation all  <br />
> the time. Sometimes for every frame, so I guess displaylists are  <br />
> also out of the question.<br />
> I&#8217;m glad to hear that 1.5.3 will improve on some of this. Im very  <br />
> much looking forward to the new updates. I guess it will also be  <br />
> worth porting my code to Java.</p>
<p>You can, FWIW, use displaylists which are only applicable to the  <br />
geometry. However there&#8217;s a bug in 1.5.2 for mulitple instances of  <br />
gridshape or nurbs with @displaylist 1. Here&#8217;s how I might do it: use  <br />
one instance of jit.gl.gridshape wiht @displaylist on, use ignore  <br />
attributes, and then update the gl state in sketch for each plane to  <br />
render.</p>
<p>In Jitter 1.5.3/sketch there is a jit.gl.multiple object which takes  <br />
incoming matrices for position, rotation, texture, etc. to draw many  <br />
instances of one object with much higher performance than doing this  <br />
in the patcher or JS.</p>
<p>-Joshua</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/sketch-drawobject-efficiency/#post-78510</guid>
					<title><![CDATA[Re: sketch drawobject() efficiency]]></title>
					<link>http://cycling74.com/forums/topic/sketch-drawobject-efficiency/#post-78510</link>
					<pubDate>Thu, 08 Jun 2006 22:33:43 +0000</pubDate>
					<dc:creator>Thijs Koerselman</dc:creator>

					<description>
						<![CDATA[
						<p>Thanks I&#8217;ll try that.  jit.gl.multiple sounds really great!</p>
<p>-thijs</p>
<p>On 6/8/06, Joshua Kit Clayton <jkc @musork.com> wrote:<br />
><br />
><br />
><br />
> You can, FWIW, use displaylists which are only applicable to the<br />
> geometry. However there&#8217;s a bug in 1.5.2 for mulitple instances of<br />
> gridshape or nurbs with @displaylist 1. Here&#8217;s how I might do it: use<br />
> one instance of jit.gl.gridshape wiht @displaylist on, use ignore<br />
> attributes, and then update the gl state in sketch for each plane to<br />
> render.<br />
><br />
> In Jitter 1.5.3/sketch there is a jit.gl.multiple object which takes<br />
> incoming matrices for position, rotation, texture, etc. to draw many<br />
> instances of one object with much higher performance than doing this<br />
> in the patcher or JS.<br />
><br />
> -Joshua<br />
></jkc></p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

