Dark Theme & Bloom


Dark Theme

after I returned back to the project I saw that the UI colors are weird and too bright. so i decided to turn it to dark :)

Bloom

I was searching in the internet until I found a Fluid Simulation. It was so cool but the most importantly it has effects and one of them is Bloom i liked it so i wanted to implement it to my project so i searched how to create bloom effect.

The main process is:

1- Create a copy of the current image that only contains the "bright" pixels.

2- Blur that copy for a certain percent.

3- Add the result to the original image.


The bright pixels will be determined by a threshold were if any of the pixel rgb values is above the threshold it will be considered a bright pixel. The threshold can be specified by the user.

The recommended way to blur was something called Gaussian Blur. Its the same as box blur but every pixel is multiplied by a certain value from this Gaussian function 2D :

x and y represent the x and y difference between the pixel you are taking its value and the center cell that you are calculating its blur for.      "a" here represent the standard deviation.

So to calculate Gaussian Blur for the pixel k you need to loop through a number of pixels (one of them is the pixel j) around k as a box where k is in the center then apply the function by taking the difference between x and y positions for the pixel j and k and putting them as the x and y inputs for the equation. You can choose for "a" what ever you want, then you take the output of the equation and multiply it by the pixel j rgb colors and add it to a sum. Do it for all the pixel around k including k itself, then set k to be the sum divided by the sum of all the Gaussian outputs. (I hope I explained it well)


That's it. I hope this devlog was helpful :)

Files

Reaction Diffusion Simulator 14 MB
Aug 01, 2021

Get Reaction Diffusion Simulator

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.