Giter VIP home page Giter VIP logo

3d-ca's Introduction

3D CA

A 3-dimensional cellular automata engine written in C++, powered by Vulkan. It allows for viewing and customizing various cellular automata. It's fast and allows for rendering huge grids of cells using ray marching through a dense voxel octree. The automaton's states are updated on a set interval using compute shaders. This project currently works only for Windows.

Compilation

To compile this code you need to have the LunarG Vulkan SDK installed.

The project is compiled simply using cmake:

cmake --build <build-directory-name>

When modifying shaders, they need to be recompiled. To compile shaders, first go into the shaders directory and run:

./compile.bat

Then, run an exporter tool (which is compiled alongside the main executable) that exports shader Spir-V code into an embeddable C++ source file:

cd <build-directory-name>
shader_export.exe

Keep in mind that currently this project requires your machine to support Vulkan 1.3 (which is subject for change in the future). All other dependencies are included in the deps subdirectory.

Controls

Press ` to open/close the GUI, F1 to lock/unlock the mouse. WASD for standard camera movement, Space to move up, LShift to move down, arrows or mouse for camera rotation.

Gallery

image image image

Potential improvements/extensions

  • make the code look a bit nicer as it's pretty rough right now
  • make the vulkan renderer a bit more low-end machine friendly
  • more automaton presets or customization options
  • more ways to customize cell coloring
  • try packing two cells into one byte to halve memory usage and see how performance changes
  • further optimize the fragment shader
  • render automaton bounds so it's easier to see where it actually is
  • maybe allow for non-power-of-two grid widths
  • maybe support linux

3d-ca's People

Contributors

quazuo avatar

Watchers

 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.