gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Graphics > an important question

#25506 - tomer - Tue Aug 24, 2004 5:52 am

Which mode will plot pixels faster?
is it faster to draw 8-bit ot 16 bit?
I am trying to improve my 3d engine, and it's important
for me to know, if I can make it faster on mode 4.

Cheers, Tomer!

BTW-> if anyone know, how to construct the viewing frustum normals,
then I have a question.

#25512 - rapso - Tue Aug 24, 2004 8:46 am

tomer wrote:
Which mode will plot pixels faster?
is it faster to draw 8-bit ot 16 bit?
I am trying to improve my 3d engine, and it's important
for me to know, if I can make it faster on mode 4.

my engine is faster with 16bit. with 8bit I had to have a backbuffer in iwram, then I copied it to the vram. it was slower. but I do not know any other way how to solve the 16bit allignment problem.

at the moment I'm drawing about 3.2k triangles with a resolution of 120x80. I think it's faster 'cause it doesn't matter how many pixels you 'could' write at once, because of the texturelookup you're working with just one pixel at time.

but I haven't testet my flat-rasterizer.


tomer wrote:

BTW-> if anyone know, how to construct the viewing frustum normals,
then I have a question.

yes :)
but before you ask, maybe it helps to take a look at: http://www.racer.nl/reference/vfc.htm

greets
rapso

#25513 - tepples - Tue Aug 24, 2004 9:05 am

rapso wrote:
at the moment I'm drawing about 3.2k triangles with a resolution of 120x80. I think it's faster 'cause it doesn't matter how many pixels you 'could' write at once, because of the texturelookup you're working with just one pixel at time.

You could unroll your texture loop, shifting four pixels into a register and then writing them all out at once, no?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#25516 - rapso - Tue Aug 24, 2004 9:34 am

tepples wrote:
rapso wrote:
at the moment I'm drawing about 3.2k triangles with a resolution of 120x80. I think it's faster 'cause it doesn't matter how many pixels you 'could' write at once, because of the texturelookup you're working with just one pixel at time.

You could unroll your texture loop, shifting four pixels into a register and then writing them all out at once, no?

1. not really, what about h-lines with a lenght of 3 5 or 7? there's a pixel left, but I cannot read from the vram, so I cannot set the last pixel.
2. I think there's an 16bit alignment for writing to the vram, it would be not that easy to draw a line in 8bit mode. (i'm not that sure about the alignment-restriction)

greets
rapso

#25524 - tomer - Tue Aug 24, 2004 1:34 pm

Hi
I am having a problem with constructing the view-frustum planes
in world_space, can you help me?

#25529 - rapso - Tue Aug 24, 2004 2:03 pm

tomer wrote:
Hi
I am having a problem with constructing the view-frustum planes
in world_space, can you help me?


I can try to, I've replied in the other thread. ;)

greets
rapso

#25543 - sajiimori - Tue Aug 24, 2004 6:26 pm

Quote:
1. not really, what about h-lines with a lenght of 3 5 or 7? there's a pixel left, but I cannot read from the vram, so I cannot set the last pixel.
You can read from VRAM.
Quote:
2. I think there's an 16bit alignment for writing to the vram, it would be not that easy to draw a line in 8bit mode. (i'm not that sure about the alignment-restriction)
It's not so hard. Start by writing a basic pixel plotting function and use that, but for faster lines you'll want to optimize your plotting for each case, like slopes between 0 and 0.5, 0.5 to vertical, etc.

#25572 - rapso - Wed Aug 25, 2004 7:50 am

sajiimori wrote:
Quote:
1. not really, what about h-lines with a lenght of 3 5 or 7? there's a pixel left, but I cannot read from the vram, so I cannot set the last pixel.
You can read from VRAM.

you're right, I've looked at the papers... i don't know why I was thinking that all the time long. *curious*

sajiimori wrote:
Quote:
2. I think there's an 16bit alignment for writing to the vram, it would be not that easy to draw a line in 8bit mode. (i'm not that sure about the alignment-restriction)
It's not so hard. Start by writing a basic pixel plotting function and use that, but for faster lines you'll want to optimize your plotting for each case, like slopes between 0 and 0.5, 0.5 to vertical, etc.

yes, if you can read from the vram it isn't that difficult.


the way I was trying to solve this problems was a s-buffer rasterizer. it's nearly finished ;)

greets
rapso