Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Lewin committed Jul 25, 2024
0 parents commit 4c263a3
Show file tree
Hide file tree
Showing 46 changed files with 4,143 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Gemfile.lock
_site/
1 change: 1 addition & 0 deletions DevelopmentBuild.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bundle install
1 change: 1 addition & 0 deletions DevelopmentServe.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jekyll serve --livereload
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source "https://rubygems.org"

gem "jekyll"

gem 'wdm', '>= 0.1.0' if Gem.win_platform?
9 changes: 9 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Copyright (c) 2024 Electronic Arts Inc. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of Electronic Arts, Inc. ("EA") nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

# PB-MPM
[![BSD3 Clause](https://img.shields.io/badge/license-BSD3_Clause-blue.svg)](LICENSE.md)
[![Version](https://img.shields.io/badge/version-1.0.0-green.svg)](VERSION.md)

This package is an accessible WebGPU implementation of Position Based MPM (PB-MPM).

<img src="data/blockCrusher.gif"> <img src="data/coiling.gif"> <img src="data/colliders.gif"> <img src="data/splashing.gif">




## Building

PB-MPM is based on WebGPU. Currently, this restricts its use to the Chrome and Edge browsers.

1. [Install Ruby](https://www.ruby-lang.org/en/documentation/installation/)
2. Run `bundle install`
3. Run `jekyll serve --livereload`
4. Open a browser window at [`localhost:4000`](http://localhost:4000)

## Reference

> *Chris Lewin*. **[A Position Based Material Point Method](https://seed.ea.com)**. ACM SIGGRAPH 2024.
## Authors

<p align="center"><a href="https://seed.ea.com"><img src="data/SEED.jpg" width="150px"></a><br>
<b>Search for Extraordinary Experiences Division (SEED) - Electronic Arts <br> https://seed.ea.com</b><br>
We are a cross-disciplinary team within EA Worldwide Studios.<br>
Our mission is to explore, build and help define the future of interactive entertainment.</p>

## Contributing

Before you can contribute, EA must have a Contributor License Agreement (CLA) on file that has been signed by each contributor.
You can sign here: http://bit.ly/electronic-arts-cla

## Research Resources
- [incremental_mpm](https://github.com/nialltl/incremental_mpm)

## License
- The source code is released under a *BSD 3-Clause License* as detailed in [LICENSE.md](LICENSE.md)
4 changes: 4 additions & 0 deletions VERSION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Version History

## Version 1.0.0 (August 2024)
- Initial release following SIGGRAPH 2024 talk "A Position Based Material Point Method" by Christopher Lewin (SEED, Electronic Arts)
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
exclude:
- DevelopmentBuild.bat
- DevelopmentServe.bat
Binary file added data/SEED.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/SEED_inverted.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/blockCrusher.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/coiling.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/colliders.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
122 changes: 122 additions & 0 deletions data/rotate.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/splashing.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<!DOCTYPE html>
<html>
<head>
<title>Home</title>

</head>

<body id="body" style="background-image:linear-gradient(217deg, rgb(1, 4, 30), rgb(10, 3, 1) 50%); margin:0; width: 100vw; height:100vh;">
<main id="main">
<link rel="stylesheet" href="style.css">
<canvas id='canvas' style=" position:absolute;"></canvas>
<canvas id='vectorCanvas' style="position:absolute;"></canvas>
<div id="ui" class="uiPanel" style="display:none">

<div id='uiPanel' style="height:100%" >
<button id="settingsTabButton" style="position: absolute; height:5%; width:33.3%">Settings</button>
<button id="shapesTabButton" style="position: absolute; height:5%; left:33.33%; width:33.3%">Shapes</button>
<button id="performanceTabButton" style="position: absolute; left:66.66%; height:5%; width:33.3%">Stats</button>

<div id="settingsTabContent" style="position:absolute; top:5%; height:95%; width:100%;">
<form id="uiContainer" style="height:100%; width:100%; background-color:rgba(23, 27, 36, 0.8); overflow:auto;">
<!-- Automatically generated UI goes here -->
</form>
</div>

<div id="shapesTabContent" style="position:absolute; top:5%; height:95%; width:100%; display:none; background-color:rgba(23, 27, 36, 0.8); overflow:auto;">
<button id="saveSceneButton" class="inputCombo">Save Scene</button>
<button id="loadSceneButton" class="inputCombo">Load Scene</button>
<div id="shapesList">

</div>
</div>

<div id="performanceTabContent" style="position:absolute; top:5%; height:95%; width:100%; display:none; background-color:rgba(23, 27, 36, 0.8); overflow:auto;">
<output class='input' id="timingStats">Timing stats are not available.</output><br>
<output class='input' id="speedStats"></output><br>
<output class='input' id="gridStats"></output><br>
<output class='input' id="particleStats">Particle count is not available.</output>
</div>

<button id="uiButton" class="uiButton"><div class="uiText">Controls</div></button>
</div>

</div>

<script type="module" src="src/main.js"></script>
</main>
<div id="loadingContainer" style="display:flex; justify-content:center; align-items:center; flex-direction:column; height:100%">
<img id="loadingAnimation" src="data/SEED_inverted.png" style="width:380px"/>
<h1 id='loadingText' style="font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; color:aliceblue; text-align:left; width:300px; margin-left:170px">Loading...</h1>
<h2 id='errorText' style="text-align:center"></h1>
</div>
</body>
</html>
77 changes: 77 additions & 0 deletions scenes/4Materials.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"version": 1,
"resolution": [
1920,
953
],
"shapes": [
{
"id": "shape1",
"position": {
"x": 291.8062500000001,
"y": 239
},
"halfSize": {
"x": "195",
"y": "71"
},
"rotation": 0,
"shape": "0",
"function": "0",
"emitMaterial": "0",
"emissionRate": "0.5",
"radius": 20
},
{
"id": "shape0",
"position": {
"x": 1231.80625,
"y": 751
},
"halfSize": {
"x": "195",
"y": "186"
},
"rotation": 0,
"shape": "0",
"function": "3",
"emitMaterial": "1",
"emissionRate": "5.3",
"radius": 20
},
{
"id": "shape2",
"position": {
"x": 1668.80625,
"y": 702
},
"halfSize": {
"x": "195",
"y": "186"
},
"rotation": 0,
"shape": "0",
"function": "3",
"emitMaterial": "2",
"emissionRate": "5.3",
"radius": 20
},
{
"id": "shape3",
"position": {
"x": 785.8062500000001,
"y": 723
},
"halfSize": {
"x": "195",
"y": "186"
},
"rotation": 0,
"shape": "0",
"function": "3",
"emitMaterial": "3",
"emissionRate": "5.3",
"radius": 20
}
]
}
Loading

0 comments on commit 4c263a3

Please sign in to comment.