forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Software render library

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
ReKleSS



Joined: 18 Jun 2005
Posts: 73
Location: Melbourne, Australia

PostPosted: Mon Jun 20, 2005 4:54 pm    Post subject: Software render library Reply with quote

Hi all,
Since nobody has figured out how to use the psp's 3d hardware to draw polygons to the screen, I thought I'd do the next best thing and write a software renderer. It's available from http://www.innerworldadventures.com/renderer.tar.bz2. (Pay no attention to innerworldadventures.com, I just admin it and make use of extra space and bandwidth.) Anyway, what works:
    Raster lines
    Raster polygons
    Filled raster polygons
    3d lines
    3d wireframe polygons
    3d filled polygons

What's still to be done:
    Backface culling
    Z-Buffering
    Text rendering
    User input library

The render library was designed to resemble OpenGL, but seriously stripped down. It does what it should, draw (flat) polygons. The raster library may also be of interest. Anyway, this is still very early and probably has a few bugs... Post them here and I'll try to fix them up for the next release. The only problem that comes to mind at the moment is that the axis passed to rend_rotate must be normalized, since I haven't got an implementation of sqrt() yet and can't do it there.

trig.rb is a Ruby script that generates my precalculated sin, cos and tan tables.

All the library code (render.*, matrix.*, raster.*, test.c, trig.*) is under the BSD license. The rest (startup.S, param.sfo, icon0.png, etc) were taken from nemnem's helloworld.

The demo program (eboot.pbp, test.c) is a sample of how to draw stuff. left, right, up, down, triangle, X, R and L to move the triangle around. Go crazy.

-ReK
Back to top
View user's profile Send private message
71M



Joined: 21 Jun 2005
Posts: 122
Location: London

PostPosted: Tue Jun 21, 2005 5:39 am    Post subject: Reply with quote

Hi ReKleSS,
Nice work on the demo! :)
If you want to a SQRT function, you can download the source to my demo over at http://www.psphacker.com/forum/showthread.php?t=635
The SQRT function is only a rough estimate and not that precise, so don't go calculate any flight paths with it :)
I found it very hard developing a PSP demo without the basic functions of a PC!

Hope you find something useful.

Cheers,
71M
Back to top
View user's profile Send private message
neofar



Joined: 21 Jan 2004
Posts: 47
Location: Spain

PostPosted: Tue Jun 21, 2005 5:02 pm    Post subject: Reply with quote

and can try this
http://pspdev.ofcode.com/api.php?simpleSearch=&keyword=sqrt
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
71M



Joined: 21 Jun 2005
Posts: 122
Location: London

PostPosted: Tue Jun 21, 2005 5:23 pm    Post subject: Reply with quote

neofar wrote:
and can try this
http://pspdev.ofcode.com/api.php?simpleSearch=&keyword=sqrt


I could never get those to work. what're the parameters?
Have you had any luck using them?

Cheers,
71M
Back to top
View user's profile Send private message
Vampire



Joined: 12 Apr 2005
Posts: 138

PostPosted: Tue Jun 21, 2005 5:33 pm    Post subject: Reply with quote

71M wrote:
what're the parameters?

takes a float value and returns a float value...
Back to top
View user's profile Send private message
neofar



Joined: 21 Jan 2004
Posts: 47
Location: Spain

PostPosted: Tue Jun 21, 2005 5:36 pm    Post subject: Reply with quote

nop .... but it's very very probably to be a

Code:
float function(float);


You should read this
http://forums.ps2dev.org/viewtopic.php?t=2197
I don't know how psp works with floats, or if this is important here..
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
71M



Joined: 21 Jun 2005
Posts: 122
Location: London

PostPosted: Tue Jun 21, 2005 5:49 pm    Post subject: Reply with quote

Very useful indeed!
I'll take a closer look at that now...

Thanks,
71M
Back to top
View user's profile Send private message
ReKleSS



Joined: 18 Jun 2005
Posts: 73
Location: Melbourne, Australia

PostPosted: Tue Jun 21, 2005 6:42 pm    Post subject: Doesn't work Reply with quote

I've already tried this (for the trig functions). If you as much as add them to startup.s, the psp will freeze. This is probably because the prx with the functions isn't loaded. If you can find the prx and load it, that might work...

-ReK
Back to top
View user's profile Send private message
ReKleSS



Joined: 18 Jun 2005
Posts: 73
Location: Melbourne, Australia

PostPosted: Mon Jun 27, 2005 12:59 pm    Post subject: Reply with quote

Finished version 2. This is basically the full featureset, the only thing left is optimization, which will probably never be done because it's pretty boring and chp has almost finished with the 3d hardware. Anyway, texturing, z buffering and backface culling are all included in this release, as well as my own text rendering code (no more pg.c!). It's available from http://www.innerworldadventures.com/psp_renderer_v2.tar.bz2. If you want to compile it, you'll need at least the 20050625 toolchain.

I've also written up a bmp to c file converter (it was in the last release) and a program to build my font.c file. Both are at http://www.innerworldadventures.com/utils.tar.bz2.

No sample code included this time, I'm working on a little proof-of-concept game that will demonstrate most of the features. In the meantime just read the header files.

EDIT: The sample code is up at http://www.innerworldadventuse.com/core.tar.bz2. I've also noticed that the texture mapping isn't as effective as I thought - I'm looking into that now.

-ReK
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group