2^2 = 2x2 = 2+2
It is 4.
Today marks a month of me doing this. I admit that I like writing. I dislike people reading my writing to me.
I have started contemplating whether I should automate some parts of the process, but it would be suuuuch a pain in the ♥♥♥.
Oh well. Future me will know the answer.
I have also changed blog layout in the main page. Surprisingly, I feel like my "spam" blogs turned out a lot better than the ones
I had before, so I should highlight some select ones instead that I actually like instead. I could edit them to be more like what I want,
but I think it is better to preserve them, even if I don't like them.
Prelude to the next section
The other day, I was running a TTT server in gmod for my friends. I've been running some custom weapons and modifications to the gamemode,
since the weapons it comes with are ancient (though not entirely in a bad way) and to add new features. Apparently, though, the TTT gamemode still
gets updated, and overwrote some of my previous work which I hadn't saved anywhere else. That sounds bad, but reallistically I only had to redo a couple of things
since not every file was replaced. Anyways, I got all that fixed, except for (unknown to me at first) an issue that caused a massive error on screen when ADSing.
You see, I never had this issue. gmod scripting is really powerful and its one of the reasons why I like Lua so much, but it's also finnicky.
It turns out that not all files are shared over a p2p server (only some!!!), so sometimes clients just get really annoying errors of stuff just not loading,
and not even knowing what.
Issues like this ♥♥♥♥♥♥♥ suck. So, I sought out an environment where I could get a clean install,
so that I could replicate this issue. I could just use my laptop as a client to test on, but I don't want to keep it at a "fresh install", and its also just annoying
cause I don't have the desk space and the trackpad is annoying.
So, I decided to try using a virtual machine, with extra effort put into making it fast. Of course, despite the annoyance, just using the laptop as a second client works.
But, it wouldn't be any fun if it wasn't complicated. And, it'll save me time in the future if something similar happens again
(of course, I can also use it for any of my other programming ventures in the future as well).
High-speed virtual machines
I have decided to use virt-manager
on my laptop to test the idea. I don't currently run any flavor of Linux on my desktop (though
that's subject to change in the near future), so I would need some alternative or some form of trickery (or an install of
Mint ^_^) to do this on my desktop.
That's a problem for another day though.
I have run point-and-click 2D games before on normal VMs, and they worked fine. The first game I chose to run on this machine, though,
was the original Half Life. Image below related.
Not only should Half Life work comfortably on my setup, but it is a game from a specific time period
where it has the option to either be rendered with "software" (native CPU rendering) or with OpenGL.*
Therefore I could test low loads on both the CPU and GPU with the same game.
As expected, the CPU blitzed through rendering when on software rendering. Since I didn't have GPU passthrough, OpenGL
rendering must've been done on CPU, and caused the game to run very poorly, even in menus. I was surprised this worked at all, even in its ♥♥♥♥♥♥♥♥♥.
The next step was to start setting up GPU passthrough in the VM. I have both a dedicated GPU, and an iGPU in the processor, so theoretically
I could render my host machine with the iGPU and pass the dedicated GPU to the VM.
I was able to get the dedicated GPU to pass through, however, this was at the expense of my host machine becoming unusable because
it was using the dedicated GPU to render... oops.
Anyways, that's as far as I get for this week. I like to ♥♥♥♥ around with this kind of ♥♥♥♥ in class
when I am bored (90% of the time), and classes for this week have ended, so hopefully I finish with this next week.
* Sidenote
Having worked with graphics rendering stuff in the past, I am still amazed that realtime graphics rendering is possible.
To gain a sense of the magnitude of the number of calculations that are done for graphics, take a simple fragment shader
(also known as a pixel shader) that colorizes an image to red, which should produce an output like this:
In HLSL, the code would look something like this (I did not test it):
//this is the only relevant code, but there is boilerplate to be had, omitted here
float4 frag(Fragment_Stage_Input input) : SV_TARGET
{
float4 col = tex2D(_MainTex, input.uv);
float avg = (color.r + color.g + color.b) / 3.0;
float redValue = clamp(avg * 2, 0, 1);
float otherChannelsValue = clamp(avg - 0.5, 0, 0.5);
col = float4(redValue, otherChannelsValue, otherChannelsValue, 1);
return col;
}
Say for instance that this shader is running on a screen with 1920 x 1080 resolution @ 60fps. Then, this function would run 124 million times
a second. If I devoted my life to doing the math to run this shader for one second, I actually would not be able to finish that. I don't think I can
do the math fast enough.
Right, and that's a pretty simple shader, running at a (nowadays) low resolution * framerate combination, and not accounting for any overhead.
Although the workloads of a renderer and the above shader are different and not directly comparable,
the whole rendering process is still much more computationally expensive overall.
So, it is incredible to me that something as intensive as a realtime 3D renderer can be put entirely on the CPU, and that they actually worked with a playable framerate
even 25 years ago, on ♥♥♥♥♥♥ dinosaur-era processors (albeit people ran lower resolutions).
It gives me a sense of wonder, that computers really are just so ♥♥♥♥♥♥♥ fast.
Grapefruit juice so gooood
This is 8 grapefruits worth of juice. It was so good. It didn't take me too long, but I could definitely tell that
this process is not good for my wrists. This is definitely something to do only every now and then.
The return button is over yonder.
The button to return is down here, or maybe alternatively the back button at the top of your browser, or maybe you can press MOUSE5 (or MOUSE4 in zero-indexed schemes). That is, unless if you changed your binds, but you would never.