Commit b2977dac

Simplify the window light creation and use the correct minimum value when calculating room light intensities


Hello! Sooner than I expected the weird ambient light flicking issues that happened when rooms affected by light sources from multiple other rooms seem to be resolved. That puts an end to the light saga for the time being.
On to new things. 🙂

Commit 26573d5f

– Only take the 10 closest light sources per tile into consideration
– Do not update per-tile light index information unnecessarily  

Resolves #58


Hi! Every tile can keep track of up to 10 different light sources that can affect it. Until now, every light source was taken into consideration (read: the first ten), so if a room (or more likely the great outdoors) had more than ten light sources, every light source above that threshold would have no visible effect.
This is now remedied by simply sorting the possible light sources by distance. While doing that, I also did a fair share of profiling to discover a lot of updates to these index values even though they didn’t change on every tick, that too is now remedied as well as some minor optimisations. So I will deem this good enough for the time being.
That means for now the remaining problem are some rather unfortunate recursive ambient light calculation issues when rooms are connected through windows. The end of this topic is finally in sight 🙂

Commit 0327b7c1

– Apply local light levels to tiles, walls and models
– Add support for spot lights    

Resolves #46, #45, #44


Hello! This takes the whole lighting topic bit closer to the phase of dotting some Is (optimisation) and crossing some Ts (making sure to only take the closest light sources into consideration). That luckily means there probably aren’t going to be any major changes in the current approach, so without any further ado, the current state:

Commit d316b353

Flesh out the light calculations more (floor + wall tiles)

Relates to #44, #46


Hello! Finally some visual progress is being made, the entire lighting topic starts to come together. There is still a lot of smaller and bigger tasks until I’ll consider it done, but hopefully that shouldn’t take more than a few more weeks.
Enjoy a picture of the current state, byeeee.

Commit 862d572a

– Fix GPU memory synchronisation problems when adding/removing light sources
– Make olives compile with the current release of libvulkan
– Move some code into a utility class that was awkwardly shared between two classes before
– Very WiP implementation of better lighting for floor and wall tiles    

   Relates to #44, #46


Hello! I finally got around to update libvulkan to the newest version so that it would compile again properly without constantly downgrading to the prior version. I also fixed some broken (or plain missing) logic to properly update the light information being copied to GPU memory and fixing some bits and pieces all around the code. That should hopefully lead to some screenshot soon!

Commit 89b2bc1a

Add a second storage buffer containing information about the light sources, make the information available on the floor shader for a start

Relates to #44, #48


Hi! Basically comes as adverties, this adds a second storage buffer which contains solely the light information and copies the already existing data into it. While doing so a bug or two has been fixed as the code was basically unused up to that point.
As a proof of concept the data was made available on the floor (fragment) shader, but for the time being that is it, nothing usable is happening with it yet, that will be the next step. 🙂

Commit 8564a621

Add a proper model for the lamp object

Resolves #47


Hello! After a bit of back and forth I present: Reasonable facsimile of a lamp

Pay special attention to the floral pattern, turns out good taste can be bought

The next task coming up will probably entail jumping a bit back into the renderer side of things in order to prepare one or two more visual effects in relation to light. Let’s see! 🙂

Commit 2e8cc034

Add/remove dynamic lights when creating windows and update their light intensity/colour appropriately

Resolves #48


Hi! This commit finishes of the preliminary work on the window light logic, check out the results:

Here the light can be seen propagating less and less per room
Here, another infamous light chair can be seen acting as a light source in the room in the back, so the light level in the third room is influenced from two sides
The effect of the “artificial” light source becomes more apparent when there is no light from the outside coming in

Next thing coming up is finally a model for the lamp. Bye! 🙂

Commit 357b77f0

Fixes per-room weighted light intensity calculation and adds support for weighted ambient colour calculation

Resolves #43


Hello! This commit finishes the (preliminary) implementation of per-room ambient light calculation, but see for yourself:

The overall light intensity depends on the room size and how much light output a single light source has
Light sources may have different colours now

What is clearly still missing is a new model for, well, lamps. That as well as adding support for ambient light changes caused by windows are the next steps on the agenda. Bye! 🙂

Commit 69ceca7c

Fix operator< for the Position2Raw type as well as an off-by-one error when writing the mapping of light position to unique light id

Relates to #43, #48


Hi! The mighty light chair is returning for another appearance. This time, it seems after some quick testing, it seems tearing down and adding new walls works properly in regards to light sources being associated with the right positions. Turns out having a std::map that cannot work properly due to a faulty condition in operator<() in a containing type is not a good thing that may lead to overlapping mappings. While debugging that I had a minor epiphany about a potential off-by-one problem, but the code broke before that even mattered. Now both should be fixed though. 🙂

Still wrong is the calculation that should take the size of the containing room into consideration when calculating the ambient light intensity, same goes for light colour, which is not used at all yet. One step at a time. Bye!