Well, I was gonna do the pattern indexes and the like... But, then I got distracted making my point and directional lighting be per texel. So, texels now are lit uniformly by lights, and shadows fall uniformly across a texel. Interesting effect, not entirely sure I want to keep it? Might need to implement anti-aliasing for it. :/
Further rewrite to when to go loading chunk vertices into the graphics card, for further code efficiency, and to better compartmentalize the code and fix a minor lighting bug. Much improved. Also tried out increasing the texture resolution. Looks okay, I think, but I prefer the 16^2 resolution still. :/
Yup, did that. And redid my tonemapping a little, and also separated out ambient lighting into a deferred pass using lighting volumes, so it works on entities now. And made a lighting pass for emissions. (Things that are a little glowy, but not enough to illuminate anything else, like hot coals.)
Okay, added details for color patterns to my texture definitions. Right now I have solid, checkerboard, and random. Right now I'm thinking about applying the same system to normals, materials, emissions, etc.
Haha, no, not quite. No texture arrays as framebuffer bindings. So... I think I'm going to need to use an SSBO. I have a little experience with these, a very little. A friend wrote some code using them while I watched? But I have the code, and the wiki, and the internet. I will figure out what can be figured out. XD
Okay, finally got it working! I had to rewrite a bunch of stuff, and I was stalled for a bit because I had the decrease set too high, and the light wasn't actually reaching the ground. But! I finally got it working. Here it is, without any other lighting, and with other lighting:
Alright, figured how to use an SSBO for my GBuffers... Except, either I need to change my surface fragment shaders to compute shaders somehow, or there's no way to avoid race conditions between overlapping surfaces inside a chunk on the same instancing call, and I'll have to give up and go back to what I head before. :/
Okay, so, I've been poking at this a ton. I tried setting up blocking between overlapping fragment invocations, and it was extremely laggy. Made a short digression to implement Frustrum Culling, but it didn't help much. Thinking I might try using Transform Feedback and changing my fragment shader for a compute shader? Not sure yet. :/
Alright, did an absolute *ton* of code cleanup. Going to see about fixing that update bug next, I think, and then try and implement propagation for sky light.
Nope, transform feedback wasn't what I wanted. In the end, I ended up just rendering my opaque fragments to textures via Framebuffer, as normal, and rendering the transparent fragments to an SSBO using AMD's OIT linked list idea. Works pretty well, I think, even if I need a separate pass for sorting the transparent fragments? Now I'm making my lighting shaders make use of all this. Going pretty well, even if I need to defer some of my deferred lighting to another deferred lighting shader. :/
Okay, so! In theory, if you clone this repo and then run './gradlew build' or the windows equivalent in terminal, it should just build the project? :/ https://gitlab.com/AngularAngel/omnicraft Note, it will clone and then build like ~14 repos, so. XD
Okay, so I went to eat lunch and this bug completely disappeared. I think it's some weird thing with my environment not properly recompiling everything when I change stuff, introducing said concurrency issue? But when I clean and build, everything gets fixed. Anyway, I fixed another couple of lighting bugs, incidentally making rendering much slower when adjacent chunks are still being generated, so I increase generation distance to improve render performance. XD
Fixed the vertical lighting channel, Here's the game with all five sky lighting channels, and all the other sources of lighting too. Still incredibly laggy though, I need to work on that.