Hey guys,
I’ve been working on a voxel engine for some time now. And I have all kinds of functionality in it - terrain generation, all kinds of block types, block functionality, and a bunch of unique things.
But one thing I absolutely can’t seem to get my mind wrapped around is lighting. And by that I mean I can’t even figure it out at the most basic level.
I think I’m stuck with the wrong perspective on this. I don’t see how I’d even begin going about lighting. I hear about using vertices, shaders, etc. But how do you actually use vertices and shaders to make a block light up, so that you can begin a flood-fill type system (with the byte representing light, checking neighbors, etc.)?
So basically, I’m not sure where you even start. I’m pretty new with this kind of thing.
I’ve done a lot of research about this, but I can’t get seem to find anything that helps me get going in the right direction on this. I think people assume that people making these engines know a lot about shaders, procedural mesh building, etc. And maybe that’s true… but I sure don’t! I’m trying to learn about all of that through making this game.
Thanks in advance if you can point me in the right direction.
PS: I’m not looking for detailed code giving an implementation, exactly. I’m just looking for some information on what I can do. I mean, am I suppose to use vertices to do this, and if so, how?
Am I supposed to use a shader? Say I have a shader, how do I apply it to blocks in a voxel engine in a way to make this work?
Am I supposed to have materials? Then I can use shaders. But how do I use materials? Do I apply one to each face of the cube? And still, how would lighting be done with this system?
As you can see, I’m rather confused.