[79] Dissociative Property; Rank and File
- 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.

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.

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.

(Note how the eye vertices disappear when facing away.)
By the way, these two optimizations are caused by literally 3 lines:

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:

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.

![[158] Most Important Brick in the Least Important Wall](https://static.wixstatic.com/media/df100d_f70be6ae4318455fbbc605cd1069c6ee~mv2.jpg/v1/fill/w_980,h_410,al_c,q_85,usm_0.66_1.00_0.01,enc_avif,quality_auto/df100d_f70be6ae4318455fbbc605cd1069c6ee~mv2.jpg)
![[157] Mail Order Sacrifice](https://static.wixstatic.com/media/df100d_e284fa6c51b04524bab9d3cf9f1f6441~mv2.png/v1/fill/w_980,h_382,al_c,q_90,usm_0.66_1.00_0.01,enc_avif,quality_auto/df100d_e284fa6c51b04524bab9d3cf9f1f6441~mv2.png)
![[156] Moat of Babble](https://static.wixstatic.com/media/df100d_091e451794b14aecb494a16c15c966c3~mv2.png/v1/fill/w_980,h_705,al_c,q_90,usm_0.66_1.00_0.01,enc_avif,quality_auto/df100d_091e451794b14aecb494a16c15c966c3~mv2.png)
Comments