[Papervision3D] Can this distortion realy can't be fixed?
John Grden
neoriley at gmail.com
Fri Aug 10 20:27:23 PDT 2007
Hey Alexander, you'd probably be able to get a little bit more performance
by switching out your divisions of 2 to multiplication by .5
Division is slower than multiplication. But whats even faster is using
bitwise operations. You can test this in flash with this bit of code:
import flash.utils.getTimer;
var time:Number = getTimer();
function runDivisionTest():void
{
time = getTimer();
for(var i:Number=0;i<10000000;i++)
{
var test:Number = i/2;
}
trace("DivisionTest: ", (getTimer()-time));
}
function runMultTest():void
{
time = getTimer();
for(var i:Number=0;i<10000000;i++)
{
var test:Number = i*.5;
}
trace("MultTest: ", (getTimer()-time));
}
function runBitTest():void
{
time = getTimer();
for(var i:int=0;i<10000000;i++)
{
var test:int = i >> 1;
}
trace("BitTest: ", (getTimer()-time));
}
runDivisionTest();
runMultTest();
runBitTest();
//traces:
DivisionTest: 181
MultTest: 113
BitTest: 62
multiplication is definitely faster, might not be lightening, but in what
we're doing with 3D, every little bit counts.
If you can convert PreciseBitmapMaterial to use ints you could see a
significant increase in cpu. Even if you can't, you've got a ton of /2
operations that, at the very least, should be switched to *.5
Hope that helps,
John
On 8/10/07, John Grden <neoriley at gmail.com> wrote:
>
> I'll certainly take a look :)
>
> On 8/10/07, Alexander Zadorozhny <alexander.zadorozhny at gmail.com > wrote:
> >
> > Hi Carlos
> >
> > On 8/10/07, Carlos Ulloa < c4rl054321 at gmail.com> wrote:
> > > Anything that happens at runtime is S-L-O-W-E-R that if it's
> > precalculated.
> > Not at all, you are wrong at that.
> >
> > In fact, drawing one triangle with PreciseBitmapMaterial is several
> > times faster than rendering the very same tesselated view with many
> > BitmapMaterial triangles.
> > Using PreciseBitmapMaterial saves you vertex projections, texture
> > calculations, you have less triangles to sort. And you can't
> > precalculate tesselations for all camera positions - there are too
> > many of them.
> >
> > I would really recommend you peeking at the PreciseBitmapMaterial
> > sources.
> >
> > wbr,
> > Alexander
> >
> > >
> > > C4RL05
> > > // carlosulloa.com
> > > // papervision3d.org
> > >
> > >
> > > On 10/08/07, Chu Yue <chuyue.net at gmail.com > wrote:
> > > >
> > > > check it:
> > > > http://actionscriptarchitect.com/lab/PreciseBitmapMaterial/
> > > >
> > > > It used PreciseBitmapMaterial with away3d.It increase the
> > tessellation
> > > > automatically at runtime.any way it's better.
> > > >
> > > >
> > > >
> > > > 2007/8/9, Niall McCormack < mailinglists at itsallmememe.com>:
> > > > >
> > > > > If you increase the tessellation or the number of polygons in the
> > cube
> > > > > then the texture distortion will become less apparent.
> > > > >
> > > > >
> > > > >
> > > > > Mac moodo wrote:
> > > > > > this question bother me a long time.
> > > > > >
> > > > > > 2007/8/9, Chu Yue < chuyue.net at gmail.com>:
> > > > > >>
> > > > > >> this image:see the attachment.
> > > > > >>
> > > > > >>
> > > > > >>
> > > > > >> 2007/8/9, Chu Yue < chuyue.net at gmail.com>:
> > > > > >> >
> > > > > >> > Can this distortion realy can't be fixed? Except Improving
> > > > > Accuracy.
> > > > > >> > See the image in attachments.Attention at the red line.
> > > > > >> >
> > > > > >> >
> > > > > >> >
> > > > > >> > --
> > > > > >> > 褚跃跃 (Chuyue / Cyywill)
> > > > > >> > ----------------------------------------------
> > > > > >> > http://www.Chuyue.net
> > > > > >> > chuyue.net at gmail.com / i at chuyue.net(MSN) / QQ:187202437
> > > > > >> >
> > > > > >>
> > > > > >>
> > > > > >>
> > > > > >> --
> > > > > >> 褚跃跃 (Chuyue / Cyywill)
> > > > > >> ----------------------------------------------
> > > > > >> http://www.Chuyue.net
> > > > > >> chuyue.net at gmail.com / i at chuyue.net(MSN) / QQ:187202437
> > > > > >>
> > > > > >> _______________________________________________
> > > > > >> Papervision3D mailing list
> > > > > >> Papervision3D at osflash.org
> > > > > >> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> > > > > >>
> > > > > >>
> > > > > >>
> > > > > >
> > > > > >
> > > > > > --
> > > > > > 和实生物 同则不继
> > > > > > _______________________________________________
> > > > > > Papervision3D mailing list
> > > > > > Papervision3D at osflash.org
> > > > > > http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > _______________________________________________
> > > > > Papervision3D mailing list
> > > > > Papervision3D at osflash.org
> > > > > http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > 褚跃跃 (Chuyue / Cyywill)
> > > > ----------------------------------------------
> > > > http://www.Chuyue.net
> > > > chuyue.net at gmail.com / i at chuyue.net(MSN) / QQ:187202437
> > > >
> > > > _______________________________________________
> > > > Papervision3D mailing list
> > > > Papervision3D at osflash.org
> > > > http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> > > >
> > > >
> > >
> > _______________________________________________
> > Papervision3D mailing list
> > Papervision3D at osflash.org
> > http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> >
>
>
>
> --
> [ JPG ]
--
[ JPG ]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20070810/e8afc27a/attachment-0001.html
More information about the Papervision3D
mailing list