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 ...
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 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 );
However when I do the following, everything seems fine:
Code: Select all
sceGumOrtho( 0, 480, 272+1, 0, -1, 1 );