Road to 3D

After getting rotscale sprites to finally work (which was a pain in the ass), I grew bored of working on the 2D engine and save support. Thus, I decided to venture into the world of 3D!

No fancy pictures yet, unfortunately. While the geometry engine, which handles all of the matrix math and 3D representations, is mostly good enough to start drawing shapes, there’s still a bug somewhere that ultimately causes vertices to not have the right dimensions. In the interest of getting everything correct before rushing out into the great unknown, I have yet to begin work on the rendering engine.

The GPU is actually simpler than I expected it to be. The requirements for developers to get stuff on the screen are as follows. First, one must set up the projection and position matrices, the latter representing the camera. (It’s worth noting that on the GPU, matrices are 4×4, storing the three spatial dimensions as well as an extra W-dimension. Having the matrices be four-dimensional is useful for translation, as the relevant matrix must only be multiplied by a translation matrix; 3×3 matrices would also require an addition operation.) After optionally configuring some other properties, one must then start sending vertex lists. The DS provides four options: separate triangles/quads and triangular/quadrilateral strips. An arbitrary amount of vertices can be defined in a list under the condition that they don’t overflow vertex/polygon RAM and don’t incompletely define a polygon, but all polygons defined by said list will share the same properties: alpha-blending, fog, texture, etc. The tiniest change in a polygon’s properties will require a new vertex list to be sent. Finally, once all vertex lists have been sent, one must swap the geometry and rendering engine buffers. This will allow the GPU to start drawing all defined polygons as well as clearing the geometry engine’s buffer to be refilled as needed. The final image is seen as background 0 by the 2D display engine and can mostly be treated as such.

The progress I have made, despite my lack of visible results, is quite encouraging for me. CorgiDS is getting close to reaching a significant milestone! Still no guarantees can be made for the release date, but there’s not a whole lot of actual features left to implement afterwards. It’s been a rough ride getting this far, but compared to when I first started this blog, I feel as though I’m able to see the light at the end of the tunnel, as far away as it may be. 🙂

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s