Lessons learned and other things

So yeah. I’m posting increasingly less on this blog for no real reason it seems. I generally have a lot of stuff to write about still but I have returned this time to share some insights from the past year or so.

I realized a few days ago that I’ve been writing custom graphics rendering since the early months of 2009 or so, maybe even before that. That’s only a little short of 5 years! It doesn’t seem like a long time since time flies when you’re just working away on something.

But I guess my ultimate point here is, to cut to the chase, that I’d strongly advise against coding a game engine or rendering module from scratch. That is if you can help it, if there’s another choice accessible then chances are that’s a better choice and will allow you to get into the better parts of it quicker. If you can’t help it or you really really want to code one, do it, it’s a great experience and I’ve learned thousands of things that I never thought I would have.
And I’m not going to suggest that everyone is going to have the same type of experience that I’ve had with this, I’m sure a ton of you out there are far smarter than I am and can maybe approach it with a less-than-bruteforce method.
But I’m not alone in advising against this actually, it’s one that you run across pretty quickly when browsing online forums and stuff concerning game development and such; there’s always that one kid who wants to write an entire game, tool pipeline and engine from scratch on a weekend. 😉

And right now, it’s been like maybe a year since I really sat down in the nitty-gritty and wrote some low-level rendering or engine code and I don’t really feel it’s going to come back around any time soon- at least not the writing from scratch thing, I think I’ve gone about as far as I can with that.
No if I’d code an engine in C++ again it’d have to borrow some technology from other sources, like a renderer for example. I’ve always leaned on third-party libraries for physics but it was a long time ago I used another renderer than my own.
It’s just that there’s a lot of stuff a renderer does that I’ve often found cumbersome to design and having those things already dealt with saves a lot of time and effort.

I’d like to point out again that while I think it’s a great experience to go the “hard route” and code an engine from scratch and all that jazz I can no longer say it’s a good idea (or even a sane idea) when all one really wants to do is code a game. The benefits of rolling your own engine are generally outweighed by the inconveniences of it. (Of course it depends on any given situation but generally this has to be true, if it’s not true then you obviously know what you’re doing already and shouldn’t concern yourself.)

This is a sort of disjointed ramble, but that’s my take on it right now anyway. 🙂


… are going slowly right now.

I worked and worked on my engine, and right now- I don’t want to work on it anymore.

I pretty much lost direction with it and I don’t really know what I’m doing with it anymore, it became sort of a “thing” that I did for the sake of doing it, and when you end up correcting typos in the code comments, you know the motivation isn’t really there.
It’s in pretty OK shape right now, though. It can do some cool things, but it sucks at some other things and I will fix the suck a bit later on when I’ve regathered my motivation to work on it.

So I’m going to take a break from this engine for a little while and try to relax and do something else. I will still program stuff, just… different stuff.
I should really try to get back to working on games instead of writing this tech all the time. Not that I don’t enjoy coding the engine and solving the problems that it presents, I just can’t do it nonstop for too long apparently.

That’s that.


I never made a post that contained screenshots of this in action, so I threw up some very quick so you can kinda see what it’s going to look like.

Note: I’m going to use some props I have lying around that I will later use in a more serious way (the oft mentioned “engine demo” I’m working on…)

So here you can see the effect of the backscatter on the thin parts of the creature, like his ears and his fingers.

What this effect now does is to apply a direct term of backscatter onto the rendered model, then apply the SSS approximation (I posted about just a few posts back) onto that, so you essentially get two effects in one.
It takes a lot of tweaking and consideration before it looks good…

Here’s another example of a tree:

Again, the light source (the sun in this case) is actually visible through the leaves if the camera were to pass by under the tree, looking up, which is a very nice effect.
You can even see it in this picture. The right side of the leaves is a lot brighter than the opposite side. This is because the light is coming down in that direction.

So that’s about it. This effect isn’t perfectly implemented yet, and some values are still in hard code and don’t allow user tweaking.