Giter Site home page Giter Site logo

fractastical / cellularautomata Goto Github PK

View Code? Open in Web Editor NEW

This project forked from antonionoack/cellularautomata

1.0 2.0 0.0 107.85 MB

This is an experiment with cellular automata; Functional mod for Rem's Engine.

License: Apache License 2.0

Kotlin 100.00%

cellularautomata's Introduction

Cellular Automata

This is an experiment with cellular automata. A functional mod for Rem's Engine.

When experimenting, I found the Sierpinski Triangle the easiest to type in + most interesting: births = 1, survives = 0, states = 5.

The following images show the cellular automate with those settings:

example 1 example 2 example 3

I was inspired to experiment with cellular automata by Tantan.

Building

This is a mod for Rem's Engine, so first build the engine. Then you can build this project, e.g. with Intellij Idea. There are no dependencies besides my engine.

Run Sample

I've compiled a version including the dependencies into Demo.jar. It should run on Windows and Linux.

Simulation

My focus went more towards GPU optimizations, because they were the bottleneck at 50³ cells at the start. Now, the CPU performance could be improved substantially, e.g. by using good multithreading. Later, I added a GPU solver. Transferring the data from GPU back to CPU isn't implemented yet.

Visualization

First I implemented the visualization using instanced rendering & blocks. I added a MeshSpawner for that purpose into my engine (CellularAutomaton1). However, probably because of overdraw, the performance was quite bad, and a fractal cube with 50³ cells already caused my RX580 to go down to 30fps at 1080p.

I then tried to create chunks like in Minecraft, just to see what the performance would be. Unsurprisingly, it was no better.

Then I tried raytracing within the cells boundaries. This was a large win, and brought my fps back to 160 in 1080p (CellularAutomaton2). First I used the front face of the bounds-cuboid as a ray-starting point and a mask of where to raytrace. But this made movement inside the cell volume inpossible. I then rewrote the shader such that you're able to render from any point. The mask is now the backside of the cuboid.

Since this shader may be useful for other projects, e.g. similar ones to Teardown, I also integrated it into my engine.

cellularautomata's People

Contributors

antonionoack avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.