Dingoo [C99] Native Dingoo 3D Graphics Library


flatmush

Member
Joined
Feb 29, 2008
Messages
132
I've made a fast software 3d graphics library for the dingoo, it'll work on dingux too but I thought it was time native coding got some lovin' ;) Hopefully that "3D Game" title should stop being so much of a lie.



It's basically a fast fixed point graphics library based on an opengl style interface (changed to be more sane and optimal).

The features are as follows:
  • 3D Transformations
  • Basic clipping
  • Color interpolation
  • Power of two texture mapping.
  • Depth testing
  • Backface culling

A few features that should be completed soon are:
  • Blending
  • More advanced clipping
  • Lighting calculations
  • Mipmapping
  • Non power of two texture loading
  • Texture modes repeat and clamp
  • Texture compression
  • Linear texture filters (will be slow)
  • Perspective correction (will be slow-ish)

I'm also hoping for time to write dynamically compiled triangle fillers to make this lib extra fast (like swift-shader).

The source contains the renderer as a library since I'm reluctant to release the source as I don't want it stolen by the folk who make this thing, it can be produced on request for anybody who I think is trustworthy if they have a reasonable reason to want to see it (like to fix a bug or add features).

Note: You can turn transformations and depth testing off to use this just for the fast triangle fillers and texture mapping so this lib should be useful for most graphics tasks superseding my old graphics lib.

Download Demo Here
Download Source Here
 
Not yet, doesn't even use assembly yet but it should compile to some fairly optimal code. Don't wanna mess with asm till I do the dynarec stuff, doesn't seem much point.
 
It's not OpenGL so you can't just drop it in and compile, but it's pretty OGL like so it should be possible to port things to it.

I can't actually find where the source for any of the fgl_* functions is. Can you give me a hand?
 
Exophase said:
It's not OpenGL so you can't just drop it in and compile, but it's pretty OGL like so it should be possible to port things to it.

I can't actually find where the source for any of the fgl_* functions is. Can you give me a hand?

there is only the library, not the source :
The source contains the renderer as a library since I'm reluctant to release the source as I don't want it stolen by the folk who make this thing, it can be produced on request for anybody who I think is trustworthy if they have a reasonable reason to want to see it (like to fix a bug or add features).
 
Last edited by a moderator:
u9i said:
I didn't really get that. Who was it that was going to steal the code?

Not really stealing that's the problem, normally I don't put any constraints on my code at all and say people can use it for what they want without credit, but I don't really want that happening with this. So I'd rather anyone who wants to see the code for a legitimate reason just emailed me so that I can keep track on who's using it for what.
 
Last edited by a moderator:
Hi Flatmush,

I know pretty much know nothing about 3d programming but its always been something I wanted to mess with. Because of my lack of experience I'm not really able to guess at what the upper limits of your library are in terms of what games could be possible. I'm guessing an X-wing clone would be okay, since there won't be any terrain to render but do you think your library could handle a car racing game or am I expecting too much. I'd appreciate hearing what sort of projects you believe your library could be capable of.

Thanks
Reesy
 
Reesy said:
Hi Flatmush,

I know pretty much no nothing about 3d programming but its always been something I wanted to mess with. Because of my lack of experience I'm not really able to guess at what the upper limits of your library are in terms of what games could be possible. I'm guessing an X-wing clone would be okay, since there won't be any terrain to render but do you think your library could handle a car racing game or am I expecting too much. I'd appreciate hearing what sort of projects you believe your library could be capable of.

Thanks
Reesy

At a guess I'd say you can probably aim at playstation 1 sort of graphics, I added sprite drawing and a few other things and I can tell you how to optimize certain things to make the most from it. If you use blending or transparency that'll slow it down, and lighting/shading can slow it down. Works best with textures or flat shaded polygons. I've not yet benchmarked it for anything so I'll try to release a more complex demo to test it with at some point.
 
Last edited by a moderator:
Thanks flatmush, I've been mucking about with your library this morning and everything works brilliantly. I've been going through opengl tutorials and most things are translating over to your lib with no problems. I'll see if I can take an opengl tutorial on landscapes and create it using your setup.

Thanks for releasing the library, this is going to provide a lot of fun. Cheers!

Reesy
 
I just made a new version of FGL for the latest version of my native SDK (so you can download it from google-code). I added an animated md2 loader to allow for some more impressive 3d graphics, some screenshots are below.

screenshot3wc.th.png
screenshot2ki.th.png

 

Attachments

  • screenshot3wc.th.png
    screenshot3wc.th.png
    8.4 KB · Views: 186
  • screenshot2ki.th.png
    screenshot2ki.th.png
    7.1 KB · Views: 184
nice work flatmush. I've not made any progress at all, I'm experiencing system lock ups for no obvious reason.

If I have some code in the main() function it works fine, but if I move the section of code into a separate procedure and then call the procedure from main() the application just locks up solid. Have you had any issues like that at all?

Its probably some kind of alignment problem, I'll keep playing until I get it working....I just want to do the fun stuff...why is everything hard work :)
 
Reesy said:
nice work flatmush. I've not made any progress at all, I'm experiencing system lock ups for no obvious reason.

If I have some code in the main() function it works fine, but if I move the section of code into a separate procedure and then call the procedure from main() the application just locks up solid. Have you had any issues like that at all?

Its probably some kind of alignment problem, I'll keep playing until I get it working....I just want to do the fun stuff...why is everything hard work :)

Could be a problem with my code but pm it to me and I'll have a look.
 
Last edited by a moderator:
I found my mistake, I was hacking around in your fgl_cube_demo which mentions appDisplay as a global variable. I was using this for the display_clear and display_flip functions.

However I completely missed the fact the appDisplay is also declared as a local variable within main(), so the global variable was never actually being initialised. This is why my code worked fine when within main() but not when I moved it out of main().

I should have spotted it earlier but I'm lost without some way of debugging on the screen. .net development has made me lazy :)

I can get on with the fun stuff now.

Cheers
Reesy
 
very nice!

I was looking for some 3d engine for dingux, do you think in porting this in the future?
 
Back
Top