Hello Logicians! I’ve had a fairly pedestrian week of development, working on miscellaneous maintenance tasks. For example, I polished off last week’s work on fixed point positions by updating the save format version: position data is now saved and loaded as fixed-point instead of floating-point, matching the new data structures that are used internally. I also added a save converter to the new format so that you can use all your 0.90 saves in 0.91, and I updated the sandbox list UI to notify the user of which saves are using the old format and need to be converted.
But my biggest task this week by far was to make some major updates to the world objects shader. This all started when I decided to address an issue with how thumbnails (the little isometric component graphics that appear in the Selection Menu and on the hotbar) are rendered. In 0.90, thumbnails look different depending on the scene in which they are generated. This is because the thumbnail renders use exactly the same materials as are used to render objects in the world. World objects are affected by environment lighting, so thumbnails are too.
This is kind of weird, but it’s not a big deal in 0.90; I’m not sure if anybody but me has even noticed it. However, for some upcoming features I plan to add for 0.91, thumbnails really ought to be generated consistently and reliably, and look identical no matter where the generation happens.
So, I’ve upgraded the shader I wrote for GPU instancing. It now has two lighting modes: environment lighting and custom lighting. We use this new “custom” lighting mode for thumbnail renders, and so now it doesn’t matter where they’re created, they always have consistent lighting. I also added support to the shader for rendering in non-instanced mode, so we can use it for non-instanced decorations like the clicky part of buttons and switches, and these decorations will also have consistent, custom lighting applied to them in thumbnail renders.
Here’s the result:
If you look closely, you’ll notice a few more differences in the appearance of thumbnails between 0.90 and 0.91:
Also: while I was mucking around in the shader code, I found a way to make it run a little bit faster! So that’s nice.
It’s such a small, subtle change, but it took hours and hours of banging my head against the code to make it happen. I’m still very new to graphics programming; I’m learning quickly, but this stuff is still taking me 10x longer than it would for someone experienced. However, it’s all done now. Thumbnail lighting is independent of environment lighting, my shader is faster and more capable, and the shader code is much more organized & reusable. I’m happy with the graphics work I’ve done this week.
I’ve got a few more small maintenance tasks on my list – none of them nearly as daunting as shader work, thankfully. After those are taken care of, I’ll spend most of the next two weeks on bugfixing. Thank you to everyone who’s reported a bug in 0.90 (especially Ecconia <3), I will be going through them very soon. After that, I’ll add a couple cool new building mechanics, and then Logic World’s first major update will be ready for release!
Thanks for reading. See you next Wednesday.