Hello gopher friends,

It's been a while since I put out a video or text update on the
Eternal game engine. That's because I've been busy on implementing
some tricky stuff (instancing), and I've also had to take on some
part-time work in order to make ends meet, which is unfortunately
eating into a lot of my time. 

  ,----[ Overly-technical 3D engine guts rant following ]----\/\/-
 / 

While, the OpenGL part of implementing instancing is not 
particuarly complicated I am finding myself in a situation where 
I'm having to re-organize a lot of the fundamental structures of 
how the scene graph  works, and it's proving to be quite a bit of 
work.

Before, we just had geometry nodes, containing geometry to be 
rendered to the screen. Each geometry node has it's own bounding 
box, and every frame, we'd just check which bounding boxes of all
geometry nodes intersect with the frustrum of the active camera, 
and consider those objects for rendering.

But now, with instancing, I had to introduce the concept of a mesh
- and allow a single geometry node to contain one or more meshes,
with each geometry node being an instance of a mesh. 
So, each mesh can have multiple geometry nodes as instances, and
each geometry node can contain multiple meshes. 
Each geometry node instance still has the bounding box like before
but we can't just get the geometry nodes intersecting the camera,
because 2 of those might just be instances of the same mesh, and
we don't want to make 2 draw calls. All instances have to be 
aggregated into a single draw call, that's the whole point of 
doing instancing, to speed things up because you've got less draw
calls to make. 

Unfortunately, it gets more complicated, as each of those mesh 
instances has a different position/rotation/scale (so a different
model matrix), and may have different textures. We deal with that
by passing an array of matrices and material structs to the shader
and an array of textures. Among other things, the material struct
contains indexes into the textures array for the diffuse, normal,
pbr, etc,... textures of each instance. -- but -- we hit a snag
here. If we have multiple textures per instance, and a mesh may
have many many instances, we will quickly hit a limit on the 
number of textures we may pass to the shader. So that means that
we still have to make separate draw calls as soon as we hit this
limit. Which also means that we need to have a process in place
that figures all of this out, and generates 'draw lists' that
groups all the instances, meshes, and data required for each draw
call. It's a completely separate thing that needs to be computed,
we can't just simply iterate through meshes or instances and go 
draw them. 

I have a prelimenary implementation of this working, however, the
framerate absolutely tanked. All of this figuring out,... sorting
and grouping of meshes & instances into draw lists every frame, as 
it turns out is quite expensive to do. So expensive in fact, that 
I'm ending up with frame timings several orders of magnitude worse
than I had without instancing. 

The obvious answer to this, of course, is to not sort all of the
things, all of the time, on every frame, but instead, only update
the drawlists when something moves. In the case of an object in 
the scene moving, that'd mean we only need to add or remove it
from the collection of drawlists if it moves in and out of the
active camera frustrum. That's doable. However, in the case of the
camera itself moving, we still have to reconsider /all/ of the
objects in the scene, and we're back to a really bad slow case.
However, instead of doing the recomputation on the fly, we can 
just add the nodes with changed matrices to a list, and have the
scene graph re-compute it's draw-lists in a separate thread. The
updating of the drawlists does not have to happen every frame at
all, it's perfectly fine for objects to fade in and out a while 
after you move the camera around in the scene, especially if you 
pad the camera frustrum and make it larger than it actually is. At
least, that's the plan I have for fixing this mess, but it's going
to take me some time to do properly.
                                                                |
                                                               /
---\/\/---------------------------[end technical rant]--------'

Meanwhile,  the whole work thing has me going through random  fits
of depression. Having to explain project concepts over and over to
people who are looking to up-end the entire architecture you came
up with just for the sake of their own ego or whatever,... I did
not miss it, and I just can't handle it anymore like I used to.

I've been so burnt out of the tech industry, my BS tolerance is
just sub-zero, and a seemingly innocuous question is enough to 
set me off into the despair of the possibility of having to do
this kind of crap for the rest of my life. Don't get me wrong, I
do love writing code, and I don't even mind interacting with other
people, but as soon as any type of politics get involved, or 
buzzwords get thrown around, or people act passive agressively, I
just completely freakin' break down in despair. I don't even know
what to say,... I'm just so, so tired. I don't have the energy to
deal with any of it anymore. And that's after starting something
for 4 hours a day part-time, after having take an almost 2 year
break from any type of working for other people. I just want to
write some friggin' code and make awesome things and be left alone
beyond that, but I guess that's too much to ask. Everything has to
be justified, pleaded for, planned, laid out in detail, explained,
re-explained, argued for, argued about, bla bla bla, in the time
it took for me to go back and forth on all this shit, I could have
implemented half of it already. Please may I write some code, Sir.

A while ago I tried to apply for a woodworking job for a pipe 
organ building company just because I'm so desperately looking for
an out of this tech nightmare, never heard back. 

Anyway, I'll quit whining. :P 

I still haven't received any submissions for an Eternal ascii logo
so I guess I'll have to come up with one, so that'll be in the 
works,...

Oh yeah, in other other news. A few weeks ago I attended a VCF
in Indiana (indy classic: https://indyclassic.org/ ) - I 
spent most of the time hanging out with AJ from Forgotten Machines
( https://forgottenmachines.com ), attempting to fix some power
supplies for his fantastic Convergent Technologies machines -- 
while I was there I met another interesting character, selling
random odds and ends, including a series of interesting VOIP dumb
phones. I ended up snagging one of these. Turns out he hangs out
on lambdamoo as well. Anyway, he is starting up his own phone 
company, selling voip phones with data-only SIM cards, that 
connect to his own voip network. It's quite interesting and neat.
https://vrhelmutt.com 

- Check out this RAD ad:
    https://www.youtube.com/watch?v=Z0wXH15bnz0

Anyway, that's about all from me for now!
Take care, folks! 
Thanks for reading my nonsense as always ;)

UPDATE may 3 2024 -- vrhelmutt is now on gopher too!
                     gopher://spout.it