Complex java applet to Actionscript 3 port

Closed Posted Jul 14, 2009 Paid on delivery
Closed Paid on delivery

I need a coder, mathematically minded, and expert in Actionscript 3 and Java to port a 3d realtime software renderer, written in Java to Actionscript 3.

The renderer is a VERY complex piece of code, (almost certainly more complex than anything you've seen before) and uses complex bit shifting, mathematical tricks and other optimizations, in order to run as fast as possible.

The port would need to be done with speed in mind throughout, and use the new native int types and Vectors available in the Flash Player 10.

## Deliverables

Here is a small sample of the java code to be ported. This function is related to antialiased texture mapping.

------------------------

? ? //Multisample inner point (not near edge, all MS points valid)

? ? ? //Does 1 sample, 16 samples, or 1 bilinear

? ? ? //Includes alpha, top bit may be set depending on return path

? ? ? final int MultiSampleSlot1_16(int[] texture, boolean AllowFastRejectRadius)

? ? ? {

? ? ? ? ? while(iCurrentU216>=stw)iCurrentU216-=stw;

? ? ? ? ? while(iCurrentU216<0)iCurrentU216+=stw;

? ? ? ? ? while(iCurrentV216>=sth)iCurrentV216-=sth;

? ? ? ? ? while(iCurrentV216<0)iCurrentV216+=sth;

? ? ? if (AllowFastRejectRadius)

{

int iPos = (iCurrentV216 >> Mip16_1) * tw + (iCurrentU216>>Mip16_1);

if (iPos < 0 || iPos >= m_MipPixelsTotal1) return texture[0]; //oob

int iPointSample = texture[iPos];

int iBlankRadius = (iPointSample & 0x7f000000 ) >>> 24; //unsigned

iBlankRadius <<= (Mip16_1-16);

if (PixelBBox_s1_int < iBlankRadius) ? ? ? ? ? ? //assuming 1 extra distance from the bilinear bit, and no bilinearing (if pass)

{

//if ((iPointSample & 0x80000000) == 0) //no normal map needed, none of the MS points hit non-flat normal

return iPointSample; //nobilinear needed

//return GetBilinearSlot1(texture);

}

? ? ? ? ? }

if ([url removed, login to view] && Renderer.m_bShowMS)

{

if (m_bDrasticOverSampling) return 0x7fff80ff; //pink for bilinear

else return 0x7f0000ff; //blue = MS tex

}

if (m_bDrasticOverSampling)

{

return GetBilinearSlot1(texture);

}

? ? ? ? ? int AccAG=0;

? ? ? ? ? int AccRB=0;

? ? ? ? ? int yscanu = dudyBy4_rot - (dudxBy4_rot<<2);

? ? ? ? ? int yscanv = dvdyBy4_rot - (dvdxBy4_rot<<2);

/* ? ? ? ? if (always in bounds)

{

for (int iy=4;iy>0;iy--, iU16 += yscanu, iV16 += yscanv)

{ for (int ix=4;ix>0;ix--,iU16 += dudxBy4_rot,iV16 += dvdxBy4_rot)

{

c=texture[(iV16>>>Mip16_1)*tw + (iU16>>>Mip16_1)];

AccAG += (c & 0x7f00ff00)>>4;

AccRB += ? c & 0x00ff00ff;

}

}

}

else

*/

? ? ? ? ? {

? ? ? ? ? ? ? int iU16 = iCurrentU216 + iTopCornerOffsetU_rot;

? ? ? ? ? ? ? int iV16 = iCurrentV216 + iTopCornerOffsetV_rot;

for (int iy=4;iy>0;iy--, iU16 += yscanu, iV16 += yscanv)

{

for (int ix=4;ix>0;ix--,iU16 += dudxBy4_rot,iV16 += dvdxBy4_rot)

{

? ? ? ? ? ? ? ? ? ? ? while(iU16<0)iU16+=stw;

? ? ? ? ? ? ? ? ? ? ? while(iU16>=stw)iU16-=stw;

? ? ? ? ? ? ? ? ? ? ? while(iV16<0)iV16+=sth;

? ? ? ? ? ? ? ? ? ? ? while(iV16>=sth)iV16-=sth;

int c, ind = (iV16>>>Mip16_1)*tw + (iU16>>>Mip16_1);

if (ind < 0 || ind >= m_MipPixelsTotal1)

c=texture[0]; ? ? //oob

else

c=texture[ind];

AccAG += (c & 0x7f00ff00)>>4;

AccRB += ? c & 0x00ff00ff;

}

}

}

? ? ? ? ? return ((AccRB >> 4) & 0xff00ff) | (AccAG & 0x7f00ff00);

? ? ? }

? ?

Engineering MySQL PHP Project Management Software Architecture Software Testing

Project ID: #2801905

About the project

3 proposals Remote project Active Aug 4, 2009

3 freelancers are bidding on average $2904 for this job

farroid

See private message.

$4037.5 USD in 14 days
(92 Reviews)
6.9
developBest

See private message.

$2550 USD in 14 days
(18 Reviews)
5.8
jackchan

See private message.

$2125 USD in 14 days
(5 Reviews)
4.4