Per-pixel 3d rendering...?

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
onne
Posts: 24
Joined: Tue Aug 29, 2006 11:54 pm

Per-pixel 3d rendering...?

Post by onne »

Hi...
I wonder if anyone else has been trying to do per-pixel 3d rendering? ie. writing a phong shader or something similar.

I have written a routine for simple scanline conversion. But the performance already without any per pixel operations seems not to be very good ( 3~6fps with my test mesh (7800 verts, 13700 tris, single 128x128x32b texture) ).

I have not started optimize too much yet, as I'm pretty new to psp programming. I just wanted to hear if someone has tackled with the problem before, or has good pointers to start optimizing?

My scanline is currently storing a huge list of vertices, which is finally rendered using:

Code: Select all

sceGumDrawArray( GU_POINTS ...
and I use Gum's matrix operations for rotations and translations.

The following optimizations I have thought possible so far when browsing through this website (if you have any opinions they might prove handy)
  • 1. Matrix ops using VFPU
    2. Loading texture to VRAM (http://forums.ps2dev.org/viewtopic.php? ... light=vram) (I tried this with Raphael's valloc-stuff but maybe I didn't quite get it as I seem to have some constant black sections)
    3. Writing directly to framebuffer (without gum)
I don't know is it reasonable to write a scanline routine, but that was the only way I figured it's possible to do per-pixel shading.

I appreciate any opinions. : )


EDIT:
--------------------------------------------------------
Kind of related to this is my observation that there seems to be something weird with orthogonal projection. If I do this:

Code: Select all

sceGumOrtho( 0, 480, 272, 0, -1, 1 );
to have my projection fit the screen, I seem to get empty lines just in the middle of the screen (y=127 & y=128)

However when I do the following, everything seems fine:

Code: Select all

sceGumOrtho( 0, 480, 272+1, 0, -1, 1 );
Post Reply