Path: news.mathworks.com!not-for-mail
From: "Aleks " <aleksve@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: matlab slow in 3d visualization
Date: Tue, 17 Jun 2008 13:45:03 +0000 (UTC)
Organization: Simrad AS
Lines: 81
Message-ID: <g38f4v$qre$1@fred.mathworks.com>
References: <fltd35$8p6$1@fred.mathworks.com> <g154n2$8mg$1@fred.mathworks.com>
Reply-To: "Aleks " <aleksve@hotmail.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1213710303 27502 172.30.248.35 (17 Jun 2008 13:45:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 17 Jun 2008 13:45:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1411056
Xref: news.mathworks.com comp.soft-sys.matlab:474232


The "bench" got about twice as fast with vsync disabled, 
thnx

"Dan " <daniel.salluce@ngc.com> wrote in message <g154n2
$8mg$1@fred.mathworks.com>...
> OK, I figured out a solution for all of our NVIDIA-based 
PCs.
> 
> A couple of things first though:
> 
> - This has nothing to do with running java or not
> - This has nothing to do with the renderer really
> - This is not an issue of ATI vs. NVIDIA as I earlier 
speculated
> 
> The real problem is that the Quadro and GeForce drivers
> (v169.xx) install with Vertical sync ON as the default. 
This
> basically throttles back the GPU so that it only rendered
> frames in sync with the refresh rate of your display;
> generally removing tearing which occurs when your display
> shows midframe between GPU renders.
> 
> The Matlab bench algorithm simply turns on shading then
> alters the logo math and flushes the buffer with "drawnow"
> command. If vsync is on, the CPU is running through the 
loop
> but waiting each time for the gpu to render in sync with
> your display when it flushes. In my case this was limiting
> to about 60 fps (my LCD is @ 60Hz).
> 
> Here is the code:
> set(task,'string','3-D')
>    drawnow
>    pause(1)
>    evalc('logo');
>    set(logoFig,'color',[.8 .8 .8])
>    s = findobj(logoFig, 'type','surf', 'tag',
> 'TheMathWorksLogo');
>    set(s,'facelighting','gouraud')
>    L1 = 40*membrane(1,25);
>    L2 = 10*membrane(2,25);
>    L3 = 10*membrane(3,25);
>    mu = sqrt([9.6397238445, 15.19725192, 2*pi^2]);
>    n = 40;
>    tic
>    for j = 0:n
>       t = 0.5*(1-j/n);
>       L = cos(mu(1)*t)*L1 + sin(mu(2)*t)*L2 + sin(mu(3)*t)
*L3;
>       set(s,'zdata',L)
>       drawnow
>    end
>    times(k,6) = toc;
>    pause(1)
>    close(logoFig)
> 
> 
> Turn off vsync in the nvidia control panel by setting
> advanced 3d settings option there to FORCE OFF. 
> 
> I notice no tearing in anything I do but drastically
> increased 3D bench scores which absolutely kill the ATI
> cards I have.
> 
> I hope this helps!
> 
> "Gianni Schena" <schena@univ.trieste.it> wrote in message
> <fltd35$8p6$1@fred.mathworks.com>...
> > 
> > why is matlab so slow in 3d visualization (isosurface, 
> > isonormals, volume rotation in 3d etc) ?
> > 
> > it is Slow even with one of the best graphic cards 
> > (512 Mb gddr3 etc etc  & lates drivers ) 
> > 
> > any idea ?
> > 
> > thank you to all in advance 
>