This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Texture mapping 2D triangles


Texture mapping 2D triangles

Postby _Alex_ » Dec 28, 2005 @ 2:05am

_Alex_
pm Member
 
Posts: 29
Joined: May 23, 2004 @ 9:43pm


Postby _Alex_ » Dec 28, 2005 @ 2:50am

_Alex_
pm Member
 
Posts: 29
Joined: May 23, 2004 @ 9:43pm


Postby fast_rx » Dec 28, 2005 @ 6:27am

User avatar
fast_rx
pm Member
 
Posts: 660
Joined: Jun 10, 2003 @ 4:24pm


Postby _Alex_ » Dec 28, 2005 @ 7:18am

_Alex_
pm Member
 
Posts: 29
Joined: May 23, 2004 @ 9:43pm


Postby xPeterx » Jan 3, 2006 @ 9:10pm

The division per triangle is not the bottleneck of your polygon rasterizer. It's more important to get the scanline drawn as fast as possible.
Cache coherency plays a great role in texture mapping also.

Check out this document also (I'm not sure if you've seen it before)
http://www.multi.fi/~mbc/sources/fatmap2.txt

Cheers
xPeterx
pm Member
 
Posts: 144
Joined: Jul 28, 2003 @ 2:50pm
Location: Germany


Postby _Alex_ » Jan 4, 2006 @ 2:23am

_Alex_
pm Member
 
Posts: 29
Joined: May 23, 2004 @ 9:43pm


Postby xPeterx » Jan 4, 2006 @ 11:52am

To avoid jittering of your texture you'll probably have to make all coordinates fixed point (even the ones on screen) and use the subpixel portion of the screen coordinates to correct the ones of the texture while you're stepping through through it.

Read the link I've provided, it explains how to write a subpixel/subtexel accurate texture mapper.
xPeterx
pm Member
 
Posts: 144
Joined: Jul 28, 2003 @ 2:50pm
Location: Germany


Postby _Alex_ » Jan 4, 2006 @ 7:12pm

_Alex_
pm Member
 
Posts: 29
Joined: May 23, 2004 @ 9:43pm


Postby xPeterx » Jan 4, 2006 @ 9:46pm

xPeterx
pm Member
 
Posts: 144
Joined: Jul 28, 2003 @ 2:50pm
Location: Germany


Postby rcp » Jan 5, 2006 @ 4:43am

User avatar
rcp
pm Member
 
Posts: 184
Joined: Jul 18, 2003 @ 2:12am
Location: Duluth, GA. (Southeast US)


Postby _Alex_ » Jan 5, 2006 @ 7:56pm

_Alex_
pm Member
 
Posts: 29
Joined: May 23, 2004 @ 9:43pm


Postby xPeterx » Jan 5, 2006 @ 9:20pm

xPeterx
pm Member
 
Posts: 144
Joined: Jul 28, 2003 @ 2:50pm
Location: Germany


Postby _Alex_ » Jan 6, 2006 @ 7:23am

Thanks,
'twas not easy, but I dug up the thread. I'm assuming you're referring to this one:
http://www.pocketmatrix.com/forums/view ... s&start=30

Let me put the technique into words to make sure that I understand how it works. By intertwining the uv coordinates as follows:
A = [u7|v7|u6|v6|u5|v5|u4|v4|u3|v3|u2|v2|u1|v1|u0|v0]

A = 0 means uv = (0,0)
A = 1 means uv = (0,1)
A = 2 means uv = (1,0) etc.

So this improves cache coherency because sequential data is preloaded into the cache. So depending on the texture screen orientation we get more cache hits even if we traverse in the v direction. This also means that the texture has to be rearanged such that the intertwined addressing accesses the corresponding pixels of the original texture.

Did I get the gist of it?
_Alex_
pm Member
 
Posts: 29
Joined: May 23, 2004 @ 9:43pm


Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron