Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/decentraland-scenes/Smoke
A particle system to create smoke
https://github.com/decentraland-scenes/Smoke
decentraland
Last synced: about 1 month ago
JSON representation
A particle system to create smoke
- Host: GitHub
- URL: https://github.com/decentraland-scenes/Smoke
- Owner: decentraland-scenes
- License: apache-2.0
- Created: 2019-02-12T17:05:07.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-03-29T20:48:40.000Z (over 2 years ago)
- Last Synced: 2024-08-05T15:04:34.482Z (5 months ago)
- Topics: decentraland
- Language: TypeScript
- Homepage:
- Size: 1.52 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- Awesome-Repository - Smoke
README
## Smoke scene
This simple scene shows how to handle a particle system to create smoke.
![](screenshot/screenshot.png)
This scene shows you:
- How to use materials with transparency on a plane
- How to use billboards to keep a 2D plane always facing the player
- How to use a system to create a particle effect, spawnin and reusing multiple entities, changing their position and scale gradually
- Use an Entity pool to keep reusing the same entities instead of constantly creating new onesThere are two modules being used:
- `SmokeSource` defines a place from where smoke puffs spawn and an interval. To instance smoke puffs, it either uses idle entities from an object pool or creates new ones if they don't exist yet.
- `Smoke` updates the position of the existing smoke puffs so that they rise and slowly move in a direction set by their `SmokeVelocity` component. When a smoke puff is too far from the source, it's removed from the scene.## Try it out
**Install the CLI**
Download and install the Decentraland CLI by running the following command:
```bash
npm i -g decentraland
```**Previewing the scene**
Download this example and navigate to its directory, then run:
```
$: dcl start
```Any dependencies are installed and then the CLI opens the scene in a new browser tab.
**Scene Usage**
Note how smoke starts rising from the fireplace. Puffs of smoke have random sizes and move in random directions, but they gradually grow and straighten upwards as time goes by.
Learn more about how to build your own scenes in our [documentation](https://docs.decentraland.org/) site.
If something doesn’t work, please [file an issue](https://github.com/decentraland-scenes/Awesome-Repository/issues/new).
## Copyright info
This scene is protected with a standard Apache 2 licence. See the terms and conditions in the [LICENSE](/LICENSE) file.