Conversation
|
I’m also working on a pure C (and some inline asm) 3D engine for 32blit. In 8bit lut model with light effect and 16bit z buff. So the framebuff and z buff could fit into the 225kB framebuff area. |
|
That's a good approach, the float z-buffer in this code is extremely ambitious and predictably causes the whole thing to explode in hires mode. By hacking in a 16-bit buffer (I don't have much of an idea what I'm doing here) I can make it run in hires, but the memory cost is going to be pretty high ( as you've determined ). This is old and messy code that's really not ready for engine integration so if you have something better that would slot into the API then by all means make it a PR and we can throw this away or compare notes before Jon notices anything is up 👀 |
|
You could try mine at zenodante/Basic-3d-lib2. If you copy the mesh/texture data into ram, it would be faster. |
|
I wonder if any of this still works, and is still worth considering. At one point we were looking at some interesting 3D dungeon assets but it never really got anywhere and the PicoSystem isn't quite there for 3D (despite some amazing demos). Do we draw the line at making this a 2D-only library SDK? |
|
Could be a separate library? (Currently 99% of the code is in the example, seems it doesn't need to be that close to the SDK) |
|
Given the limitations of the hardware, I don't believe there is any single "right" way to do 3D, so leaving it up to external libraries seems like the way to go. For example it can be done without a depth buffer by sorting the triangles before drawing them. That is what newkind does. |
|
Out of curiosity I ended up trying to run this (it crashes unless I hack out any calls to Then ported the example to my renderer. |
I've rebased this and cleaned it up to use the latest and greatest SDK features- IE: asset pipeline and metadata.
TODO:
Object::update_textures()or similar.Object::loadfor consistency with the rest of the APIObject::renderorRenderer::draw(surface, object)