A downloadable game

Insert linkMy pc was overwhelmed with running the unoptimized shader and record at the same time, the application runs at normal 60 fps only the video is choppy


Hello and wellcome to my second contribution to Raph's Generative art challenge! (discord for the challene here)

For this weeks challenge "Dont Touch", i created a particle based simulation running in a unity compute shader.

The result is a particle based voronoi-noise looking simulation.
Each particle is trying to avoid all other particles by trying to simply steer away from all particles that are closer then a specified distance.

An agent consist of its position and its direction, each run, the direction is calculated to steer away from other agents as specified and added to the already existing direction and normalized to prevent excessive speeds. 

The normalized direction multiplied by the deltaTime of the frame and a universal speed value is added to the position of the agent to make the agent move.

In addition, each particle loops through all pixels within the specified range and tries to paint the pixel in a grayscale value proportional to the distance from the pixel to the particle.

float desiredColor = 1 - (magnitude / size);
renderTexture[pixelCoord.xy] = max(desiredColor, renderTexture[pixelCoord.xy].r);

for the original pixel value, any of the r, g or b part can be sampled because they will all be the same value.

d = distance, the value on the pixel is defined by the desired value

To achieve the voronoi effect, when painting a pixel, it chooses the max between the value it wants to paint and and the value the pixel already has. this way, each pixel's value is proportional to the distance to the closest agent.


The Code for the computeshader

Download

Download
Win_Alpha0.0.3.zip 23 MB

Leave a comment

Log in with itch.io to leave a comment.