GP2X My 3d Renderer (wip)


twixn

Still Fresh
Joined
Jul 20, 2006
Messages
43
Age
38
Location
Melbourne, Australia
Website
Visit site
Hey all,

For the past week (the time i have had my GP2X) i have been developing
a 3D software renderer for it. I think its coming along nicely, and i'd like
to show off what i have so far.

Its fairly simple ATM, only 2 render modes (solid colour and texture mapped).
Sorry i have no screenshots, i have yet to find a way of doing it (i will probably just
export the framebuffer to a bitmap myself, but i havent set a system up yet).

Download (only ~35k)

Keys are:
Stick: Rotate cube.
Start: Exit.
Y: Swap between texturing and solid colour.
A: Cycle through textures (texture mode only).

Some things i'd like to point out:

The Texturing is Affine. IE, not perspective corrected, i still have yet to
add that. Just remember that the texture 'warping' along a diagonal line of each face
of the cube is expected.

The textures are not loaded from disk, they use a rather hacky
procedural generation. Pretty much just playing with 'rand()'.
Thats why the size is so small, no media.

I still have lots of room to improve in terms of just the 920, but of course
once i get more comfortable with using both the chips i'll start offloading work
to the 940.

It also outputs to a log (log.txt in the same dir), it can be read using the ebook.
Although it contains nothing really interesting, besides the FPS and frame time in
milliseconds of the last frame.

Anyway, tell me what you think so far :D its very much a work in progress.

-Twixn-
 
When rendering with textures, and then rotating the cube it looks a bit like the cube is deforming, is this because of the "affine"?

It looks nice anyway :)
 
aapje89 posted on Jul 25 2006 at 10:22 PM said:
... is this because of the "affine"?

Thats right. Its not that bad, the PSX managed to get away with it :p

I plan to keep it (its excellent for sprites/billboards etc), but i plan to add
'non-affine' soon, or at least 'near' 'non-affine'.

aapje89 posted on Jul 25 2006 at 10:22 PM said:
It looks nice anyway :)

Thanks :D

-Twixn-
 
Last edited by a moderator:
I would like to see a screenshot as I don't have a GP2X yet.

If your using SDL, its as easy as:

SDL_SaveBMP( screen, "screengrab.bmp" );

or theres that FBgrab program at the archive.
 
Plans to throw a few bits and pieces together with this and throw it into the demo compettion by any chance?

Even if it's in early stages, it might have a decent chance if not enough people are actually entering the compo in the first place!
 
Blah posted on Jul 25 2006 at 11:04 PM said:
I would like to see a screenshot as I don't have a GP2X yet.

If your using SDL, its as easy as:

SDL_SaveBMP( screen, "screengrab.bmp" );

or theres that FBgrab program at the archive.

Yeah, i use SDL. Thanks for that :D

Here is a picture of the solid fill rendering:

solid.jpg



And one of the texture mapping (notice the lines on the texture,
they are 'bent').

texture.jpg



Tobriand posted on Jul 25 2006 at 11:37 PM said:
Plans to throw a few bits and pieces together with this and throw it into the demo compettion by any chance?

Even if it's in early stages, it might have a decent chance if not enough people are actually entering the compo in the first place!

Well no, but i will take a look into it now! Only a few days left so i'll try to add what i can.

Looks like i may have a good chance at the 64K demo :p

Thanks for the heads up.

-Twixn-
 
Last edited by a moderator:
Looks like i may have a good chance at the 64K demo

For the 64kb-demo contest, in the rules, the SDL-library size is counted with the executable size?

(yeah, some form of extreme-ARM-assembly for the 64kb demo can be very useful for the future of the gp2x :lol:)
 
smx posted on Jul 25 2006 at 09:38 AM said:
Looks like i may have a good chance at the 64K demo

For the 64kb-demo contest, in the rules, the SDL-library size is counted with the executable size?

(yeah, some form of extreme-ARM-assembly for the 64kb demo can be very useful for the future of the gp2x :lol:)
No, the only rule for the 64kb demo is that it has to run on a stock gp2x running firmware 2.0.0. That environment contains a dynamically loadable SDL library that could be used -- just like in the PC demo world the 64kb demos can use DirectX.

64kb demos could not use variant versions of the SDL library though that were not included by GPH on the stock gp2x.

Specifically, to qualify for the 64kb prize, an entry must consist of an archive containing ONLY a 64kb or smaller .gpe file and a file_id.diz. The entry must run on a stock gp2x without further installation requirements.

If I repeat the contest next year I may insist that the demos be completely self-contained except for linux system calls (to avoid them being broken by changes to the included libraries in future releases), but that is not the rule for this year.
 
Last edited by a moderator:
Well, i know it runs on a stock 2.0.0, so it should be fine.

I'll have to work on some content for it, something better
than just a cube.
Scratch that, im sticking with the cube,
lets just see how many special effects i can fit in 64k :p
Put the GP2X to some serious work!!

Thanks again for the positive comments :D

-Twixn-

EDIT: And i have to add, inline ARM Assembly in GCC is very nice,
much cleaner and nicer than x86.
 
smx posted on Jul 26 2006 at 08:45 AM said:
Next step... hypercube :p
[obscure movie reference]
But no throwing people in it and setting traps... that's naughty[/obscure movie reference]
 
Last edited by a moderator:
smx posted on Jul 26 2006 at 05:45 PM said:
BTW, great work!

Thanks :D its progressed quite abit (im working overtime, only one week left).


Although i do have a question, i know its supposed to be a non-interactive demo,
or at least minimal-interactive. Whats the minimum? I mean, should i set a timer
to switch between rendermodes/Textures etc? Or can i use the buttons?

I've set the cube to rotate around itself, its only switching between settings
im unsure about.

-Twixn-
 
Last edited by a moderator:
Twixn posted on Jul 26 2006 at 06:16 AM said:
smx posted on Jul 26 2006 at 05:45 PM said:
BTW, great work!

Thanks :D its progressed quite abit (im working overtime, only one week left).


Although i do have a question, i know its supposed to be a non-interactive demo,
or at least minimal-interactive. Whats the minimum? I mean, should i set a timer
to switch between rendermodes/Textures etc? Or can i use the buttons?

I've set the cube to rotate around itself, its only switching between settings
im unsure about.

-Twixn-
For the contest it would be a LOT better to use a timer. I'm allowing but not encouraging a minimal amount of interaction but the idea was that it would be for some particular artistic effect (like if you go to an art gallery most of the art you just look at but there's always that one cool thing where you push a button which changes the artwork's behavior in some interesting way).
 
Last edited by a moderator:
Dzz posted on Jul 26 2006 at 11:25 PM said:
For the contest it would be a LOT better to use a timer. I'm allowing but not encouraging a minimal amount of interaction but the idea was that it would be for some particular artistic effect (like if you go to an art gallery most of the art you just look at but there's always that one cool thing where you push a button which changes the artwork's behavior in some interesting way).

Ok, i'll set up a timer then.

What i'll do is cycle through each texture, giving each about 3-4 seconds in the limelight.
And whenever the 'Texture Cycle' loops back to the first texture i will go to the
next effect.

Simple enough, the only user interaction is X to take a screenshot, and START to
exit.

-Twixn-
 
Last edited by a moderator:
Back
Top