The story of how i, like a fool, needlessly re-invented yet another wheel

talk about going on a tangent.

right off the bat, i’m burning midnight oil like crazy. sleeplessness as in abusing caffeine for days on end, forcing myself to stay awake until this or that gets done. does bad things to the brain.

and so im sitting at my desk at four am, just about finishing up the importer for an image format ive been working on. its nothing groundbreaking: lossy compression, rgb 4bits per channel. run some tests to see if the images show up correctly and they do, but the shading on the model im testing is waay off… no hard edges, and i really really need some hard edges. dangit all.

thus begins my journey into a whole fifteen hours of nonstop tinkering that could’ve been avoided had i done some, well, thinking. i know the problem comes down to normals, the problem is im trying to imitate elden graphics: lighting is calculated per vertex the gouraud way, and i refuse to fetch any textures on the vertex shader because hardware support for that kind of mambo is a tad nightmarish to figure out. but then i try some edge splitting to get the look i want and that just generates additional data on top of the vertices i am already (virtually) duplicating at the seams to keep the multiple uvs per vertex.

what do i do? i go with it anyway, telling myself its no big deal. but that’s when i remember the fact that i yanked out skeletal animation like a month ago and have been animating basically everything by swapping one mesh for another – so every vertex gets saved once per action, per frame. i desperately went and rewrote the entire 3d model exporter, changed the file structure from head to toe, came up with some funky bit manipulation to squish in more data into less bytes, carried the changes over to the model importer. files down to about half the original size. okay.

but before patting myself on the back i do the math and half size is not nearly enough. high poly in this scenario is anything higher than two thousand, and im going over the line by about 1.9k for this character just because of edge splitting. okay. guess im screwed. havent slept in two days, the sun is setting again and im all out of brain juice. wait a minute… i was working on an image importer hours ago, i can write vectors to a file. i can READ vectors from a file… an image is a file… oooh right, i can use color data to set my normals. all i have to do is a slight adjustment to the per-vertex lighting on the fragment based on a texture. in/out on the shader, some space conversion, dump vectors to a file and i already have code to handle that.

and so, yay, crazy idea but it works. i stare at the picture my motor pushes to the screen and realize, this is just like a normal map. matter of fact, this is quite literally a normal map. oh my god. i could’ve just baked this. i could’ve done it in a much simpler way half a day ago and get it done much quicker! holy molly, this is bullsheezels!!

moral of the story is… not sure. im too absent minded for this line of work? dont be a tryhard? never forget to do the math before a major rewrite? definitively sounds like the last one to me… bonus point though is i did get file size down by a bunch, that’s something.

i dont have a good way to end this so, nighty night.

2 Likes

Go get some sleep, you’ve earned it!

Look at the bright side. You actually understand this. I have no idea what you are talking about. That is asside from normals and edge splitting. But I have no context for the complexity of the programming task.

Ignorance is bliss.

I hope you are not like me and this follows you into your dreams and you are continuing to sort it all out through some abstract concept of a world made up of code that you have to get right so that the barista can make you a morning coffee and you can swim with a virtual dolphin in a pool of 0s and 1s.

that totally sounds like my brain when i go to sleep. to eat this hotdog i must decrypt the mustard.

programming is not as hard really. theres enough libraries to streamline the more mind-numbing tasks, most of what one does then is logical gymnastics. but i like to know what goes under the hood so i can do the implementation myself and, if possible, improve uppon it/adapt it to my needs. parts of a system designed for one another at the price of more hours of work and study. i feel its worth it most of the time.

1 Like

Lol… Exactly like this.

Regards programming it is too slow for me. Which is why I have a team of artists now. As it is without even touching a line of code going from concept to screen for 3D is like running an idea through molasses.

But full respect for the Zen of programming. Modeling can be like that.