top of page
Search

[79] Dissociative Property; Rank and File

  • Writer: Conlan Walker
    Conlan Walker
  • Apr 21, 2023
  • 2 min read

The problems I had with the renderer seem to have vanished into thin air without much work (or at least not nearly as much as I thought). I was asked to make a vertex and line renderer, but I think the latter might be unnecessary for now.


The main problem with rendering came with the mismatching of triangle vertices, which ended up coming from the qsort phase of the geometry transform. While everything else seems to be working correctly (like translation, rotation, and scale), qsort was working with each vertex individually, without much care as to what face they belong to and where.

ree

This fact presented itself when I first finished the vertex renderer, where I pleasantly found everything to be working correctly, even on the high-poly stress test model that I was testing with, which is just an absurdly subdivided blender Suzanne mesh.

ree

As you can see, the renderer works fine even when working with >31.6k vertices.

(While impossible to notice with a screenshot, this was running more or less fine even without back face culling or clipping.)


With back face culling and a crude form of clipping, the frame rate improved significantly.

ree

(Note how the eye vertices disappear when facing away.)

By the way, these two optimizations are caused by literally 3 lines:

ree

Once I sorted out the whole sorting problem (for now I'm just grouping triangles by their index multiples of 3, and just comparing the first point of the triangle), this is the current state of the renderer as a whole, and what it can do:

I'll likely continue to have z-sorting issues, just due to how SDL_RenderGeometry works, so hopefully things work out on that front.


Lastly (this is something I forgot I did until just now), I apparently made a simple text library for the KIT-8, which looks like this:

ree

Whose code looks like this (hand-typed btw lol, though with the help of the almighty ctrl+v):

This is almost 900 lines, and I can't believe I forgot about making it this week until I had to write this post.

 
 
 

Comments


bottom of page