Giter Club home page Giter Club logo

godot-gpu-cellular-automata's Introduction

GPU Cellular Automata Template

GPU-accelerated cellular automata template in Godot.

Uses GLSL3, but it should be possible to run it on GLSL2 with minor tweaks.

Controls

Scroll wheel = select material

Click = place material

Enter = pause/play

Space = step once

How it works

The current state of the simulation is stored in a texture, rendered in a special viewport named Simulation/Viewport.

A simulation.shader reads the viewport to compute the next frame and writes the result back to the same viewport.

Finally, the result is shaded through the render.shader and presented on the screen.

Setup and input are handled from cellular_automata.gd.

License

Copyright (c) 2021-2022 Fabio Iotti. Released under the MIT License.

godot-gpu-cellular-automata's People

Contributors

bruce965 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

godot-gpu-cellular-automata's Issues

player collision

Hello, do you have any ideas for doing player sprite collision with sand simulation?? for example:

  1. when character jump into sand, sand will fly to the sky
  2. when character trap in sand, it will move slowly
  3. hwen character move in sand, sand will change

The way I can think is read character pixel from viewport, and when the pixel is character, do collision logic. But I can not think clearly the logic

magic effects simulation

Hello, I think you should know noita. I see the videos about noita, and that is amazing! you can see some magic effects fly around the screen. I think they have similar logic with the sand simulation, but have no clear ideas. Do you have any idea to simulate such magic logic with sand simulation? such as :

  1. spawn fire magic to hit wood and explode the wood
  2. spawn laser to stone and later logic

water seems not correct

thanks for sahring this good project.
but when i run enough time, i find some logic error. such as for water, when water falls down to ground, it should form horizontal plane quickly, but your water speed is too slow, so it is not like water, but like...ugh, maybe sand?
image

I think the problem is your speed. in your shader, you only move 1 pixel each time, this may limit something

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.