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

Optimize z-buffered flat shading


Optimize z-buffered flat shading

Postby drgoldie » Aug 7, 2003 @ 5:16pm

drgoldie
pm Member
 
Posts: 330
Joined: Jan 10, 2003 @ 10:46am
Location: Vienna


Postby Digby » Aug 7, 2003 @ 6:30pm

Digby
pm Insider
 
Posts: 1011
Joined: Apr 29, 2001 @ 1:53pm


Postby drgoldie » Aug 7, 2003 @ 9:57pm

yes i did half the w value :).

the purpose of always reading and writing was the try to use only 32-bit memory operations. of course one could optimize for the case where nothing has to be written at all.

maybe it makes even sense to optimize for cases where only 16 bits need to be updated.

i did test it with a setup where every pixel is drawn. so saving time by not processing anything for invisible pixels would not have increased performance in this test. i just wanted to see how this version compares to one that does no z-testing/writing: it is ~4x slower.

maybe i should just use the intel gpp and not bother about optimizing ppc code...

DANIEL
drgoldie
pm Member
 
Posts: 330
Joined: Jan 10, 2003 @ 10:46am
Location: Vienna


Postby rcp » Aug 8, 2003 @ 1:05am

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


Postby drgoldie » Aug 8, 2003 @ 7:50am

drgoldie
pm Member
 
Posts: 330
Joined: Jan 10, 2003 @ 10:46am
Location: Vienna


Postby refractor » Aug 8, 2003 @ 8:04am

User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


Postby drgoldie » Aug 8, 2003 @ 8:29am

drgoldie
pm Member
 
Posts: 330
Joined: Jan 10, 2003 @ 10:46am
Location: Vienna


Postby refractor » Aug 8, 2003 @ 9:13am

When you test the second pixel, in both cases, shouldn't you be testing against curZ2?

As you use it in both cases:

curZ2 = sgl_cast_int(runZ+ZStep);

can be moved up with

curZ = sgl_cast_int(runZ);
User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


Postby drgoldie » Aug 8, 2003 @ 11:32am

drgoldie
pm Member
 
Posts: 330
Joined: Jan 10, 2003 @ 10:46am
Location: Vienna


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