Giter Site home page Giter Site logo

sio2's People

Contributors

dmitriy-shmilo avatar simonwoodburyforget avatar

Stargazers

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

Watchers

 avatar  avatar

sio2's Issues

Add a fast grid indexer.

Add back a direct grid indexer. Use it in cases when index is guaranteed to be within grid bounds.

Add liquid behavior and water tool.

Create a particle behavior, which normally acts as solid falling block, but also has a possibility to shift either to the left or right side if bottom cells are taken.

Add coordinate wrapping.

When trying to index a cell out of grid bounds, a requested coordinate should wrap around. So accessing a cell at [0, -1] should return a [0, FIELD_HEIGHT - 2] cell, for example.

Solids should sink in liquids.

Particles with liquid behavior should allow other particles to swap places, effectively displacing liquids when solids are falling into them.

Add brush size.

  • Add a brush size to the ToolState struct (integer in grid cells) to indicate how big the current spawning area should be.
  • Consider spawning area to be a simple square for now.
  • Don't replace existing particles on a grid, unless using an eraser.
  • Implement a way to increase/reduce brush size.

FPS drops significantly after a hundred or so particles were spawned.

Spawning around 100-200 particles makes FPS drop from 60 to 20-30 with release build. This is most likely caused by each particle having an individual sprite attached to it. As a first take on performance improvement individual sprites should be removed, and a single texture is to be rendered on screen. Each particle would be represented by a pixel on this texture.

Add particle velocity and acceleration

  • Add current velocity for each particle.
  • Add hardcoded constant acceleration.
  • Add hardcoded maximum velocity.
  • Apply acceleration to each particle, if it's falling down.
  • Loop through each grid cell along current velocity, and stop either if another particle is encountered or current velocity is satisfied.

rendering seems to be the bottleneck

disabling the rendering system with the field width and height set to 800 x 800 lets the demo run at 60fps, there's gotta be a better way to draw the image every frame

Show brush shadow.

When cursor moves above the grid, render a shadow, which will indicate an area of brush effect.

Add eraser tool.

Add a tool, which would allow user to remove existing particles from the grid.

Crash on startup in debug mode.

thread 'Compute Task Pool (1)' panicked at 'attempt to subtract with overflow', src/render.rs:78:25
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'Compute Task Pool (0)' panicked at 'task has failed', /Users/dsh/.cargo/registry/src/github.com-1ecc6299db9ec823/async-task-4.0.3/src/task.rs:368:45
thread 'main' panicked at 'task has failed', /Users/dsh/.cargo/registry/src/github.com-1ecc6299db9ec823/async-task-4.0.3/src/task.rs:368:45

when running with cargo run.

Liquids are stuck on the right side.

When on a flat surface, liquids shift to the left and then to the right side. Liquid particles are supposed to shift back and forth, but they get stuck on the right side.

Particles aren't always square.

Grid squares are sized proportionally to the window. If window width and height aren't equal, particles will render as rectangles.

  • Always render grid as a square, using the smaller window dimension.
  • Add padding if necessary.
  • Place the grid in the center of the screen.
  • Differentiate padding and main grid with color.

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.