physbam: physically based simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · the...
TRANSCRIPT
![Page 1: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/1.jpg)
PhysBAM: Physically Based SimulationMichael Lentine, Craig Schroeder
![Page 2: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/2.jpg)
Outline
● The PhysBAM Release● What is PhysBAM● How to get and use PhysBAM
● Algorithms● Levelset● Water
![Page 3: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/3.jpg)
Outline
● PhysBAM Overview● PhysBAM_Tools● PhysBAM_Geometry● Running PhysBAM● Viewing the results● Make your own simulation
![Page 4: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/4.jpg)
What is PhysBAM?
● Code package used for physical simulation● http://physbam.stanford.edu/
● Developed at Stanford● Industry Collaboration
● Handles many types of simulations● Solids● Fluids● Coupling
![Page 5: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/5.jpg)
What is PhysBAM?
![Page 6: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/6.jpg)
![Page 7: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/7.jpg)
![Page 8: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/8.jpg)
![Page 9: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/9.jpg)
![Page 10: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/10.jpg)
![Page 11: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/11.jpg)
![Page 12: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/12.jpg)
![Page 13: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/13.jpg)
![Page 14: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/14.jpg)
![Page 15: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/15.jpg)
What is PhysBAM?
● Used in a wide range of academic papers● [Lentine et al. 2011; Schroeder et al. 2011; Lentine
et al. 2011; Kwatra et al. 2010; Lentine et al 2010; etc...]
● 18 SIGGRAPH Papers, 14 SCA Papers, etc...
● Used in a number of corporations● Industrial Light & Magic, Pixar Animation Studios,
Walt Disney Animation, Intel Corp.
![Page 16: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/16.jpg)
PhysBAM Release
● PhysBAM Tools was released in the winter● Smoke● OpenGL● Ray Tracing
● PhysBAM Geometry will be released during SIGGRAPH 2011● Levelsets● Surfaces
![Page 17: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/17.jpg)
PhysBAM Structure
![Page 18: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/18.jpg)
PhysBAM Tools
● Core set of tools for PhysBAM● Data Structures
● Arrays, Hashtables
● Math primitives● Matrices, Vectors, Quaternions
● Math Tools● Linear solvers, Optimization algorithms
![Page 19: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/19.jpg)
PhysBAM Tools
● Core set of tools for PhysBAM● Simulation objects
● Grids, Particles
● Simulation algorithms● Advection, Interpolation
● Convenience tools● Parsing, I/O, Debugging
![Page 20: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/20.jpg)
PhysBAM Geometry
● Builds on the tools library● Simple primitives
● Spheres, Boxes, Cylinders
● Meshes● Triangulated surfaces, Tetrahedralized volumes
● Acceleration Structures● Hierarchies, Partitions
![Page 21: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/21.jpg)
PhysBAM Geometry
● Builds on the tools library● Extended simulation objects
● Rigid Bodies, Deformable Objects, Levelsets
● Extended simulation algorithms● Rasterization, Intersection, Collision Detection
![Page 22: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/22.jpg)
Downloading PhysBAM
● Downloading the source● http://physbam.stanford.edu/
● Required prerequisites● GCC 4.5.2● Scons
● Optional prerequisites● libpng, libjpeg● libgl, libglu, libglut● libz, libpthread, libmpi
![Page 23: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/23.jpg)
Downloading PhysBAM
● Create directory $PHYSBAM● Download the library into this directory● Extract
● Public_Library● Projects● Scripts
![Page 24: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/24.jpg)
Compiling PhysBAM
● Use Scons● python Scripts/scons/setup_scons.py● $PHYSBAM/Sconstruct● $PHYSBAM/Sconstruct.options
● Each project has a Sconscript● scons -Q -u -j #procs CXX=”/usr/bin/g++”
![Page 25: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/25.jpg)
Compiling PhysBAM
● Environment vars● PLATFORM=nocona (64bit)● PLATFORM=pentium4 (32bit)
● Build options● shared● shared_objects
![Page 26: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/26.jpg)
Compiling PhysBAM
● Compile Flags● Parallelism
– USE_MPI, USE_LAM, USE_PTHREADS● Formats
– USE_LIBPNG, USE_LIBJPEG, USE_FFMPEG● Others
– USE_FFTW, USE_LIBZ
![Page 27: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/27.jpg)
An Example
● Download the Smoke project● http://physbam.stanford.edu/~mlentine/smoke.tar.gz● Extract inside $PHYSBAM/Projects● Comes with INSTALL file
● cd $PHYSBAM/Projects/Smoke● scons -Q -u -j 2 CXX=”/usr/bin/g++”● Creates smoke_{nocona,pentium4}● Build files are in $PHYSBAM/build
![Page 28: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/28.jpg)
Running PhysBAM
● Usage instructions● Projects come with README files● -h will display help● -scale <int> sets the resolution● -2d, -3d sets the dimensions● -e <int> sets the last frame● -restart <int> sets a frame to start from● -substeps <int> outputs data every step
![Page 29: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/29.jpg)
An Example
● ./smoke_pentium4● Default parameters
● Resolution is 50x100– 3d is 50x100x50
● Starts from frame 1● Ends at frame 100
![Page 30: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/30.jpg)
An Example
● Writes to directory $PHYSBAM/Smoke/output● A directory for each frame with frame specific data
– mac_velocity, density● A common directory for all frames
– grid
![Page 31: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/31.jpg)
Projects
● Tools projects● Smoke● Projection● Advection
● Geometry Projects● Water● Levelset
![Page 32: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/32.jpg)
Viewing the Results
● View the results from the output directory● Opengl viewers
● opengl_1d● opengl_2d● opengl_3d
● Ray tracer● Only works in 3d
![Page 33: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/33.jpg)
OpenGL
● Three independent viewers
![Page 34: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/34.jpg)
1D Viewer
![Page 35: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/35.jpg)
2D Viewer
![Page 36: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/36.jpg)
2D Viewer
![Page 37: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/37.jpg)
3D Viewer
![Page 38: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/38.jpg)
3D Viewer
![Page 39: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/39.jpg)
Commands
● Playing● “p” play● “s” step● “ctrl+s” step back● “r” restart● “z” end● “g” goto● “ctrl+d” capture*
![Page 40: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/40.jpg)
Commands
● Visualization● “V” show velocity● “d” show smoke● “6” show grid● “-” decrease velocity size● “=” increase velocity size● “ctrl+h” slice mode● “[“ and “]” increment and decrement slices● “\” change slice axis
![Page 41: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/41.jpg)
An Example
● ./opengl_1d_pentium4● ./opengl_2d_pentium4● ./opengl_3d_pentium4● Takes in directory as argument
● Use directory $PHYSBAM/Projects/Smoke/output
![Page 42: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/42.jpg)
Ray Tracing
● OpenGL is good for testing/debugging● Ray tracing produces better results
● Higher quality images● Slower
● Uses a scene file to draw objects
![Page 43: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/43.jpg)
Ray Tracing
![Page 44: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/44.jpg)
Ray Tracing
![Page 45: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/45.jpg)
Scene File
● Set of general options● Sky, rays per pixel
● Camera● Lights
● Point lights, area lights, spotlights
● Materials● Shaders
![Page 46: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/46.jpg)
CameraCamera{
Location=[x y z]Look_At=[x y z]Pseudo_Up=[x y z]
Field_Of_View=dFocal_Distance=dAspect_Ratio=d
Width=iHeight=iOutput_Filename="str"
}
![Page 47: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/47.jpg)
Point Light
Light{Name="str"Type="Point"Color=[r g b]Position=[x y z]Power=iCasts_Shadows=b
}
![Page 48: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/48.jpg)
Spotlight
Light{Name="str"Type="Spotlight"Color=[r g b]Position=[x y z]Power=iCasts_Shadows=bDirection=[x y z]Cone_Angle=aPenumbra_Angle=a
}
![Page 49: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/49.jpg)
Scene File
● Simulation objects● Deformable bodies● Rigid bodies● Levelsets● Voxel data
![Page 50: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/50.jpg)
Voxel Data
Object{Name="str"Type="Voxel_Data"Grid_Filename="output/common/grid"Density_Filename="output/%d/density"Volume_Shader="SmokeShader"Volume_Step=d
}
![Page 51: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/51.jpg)
Deformable Object
List_Object{Name="str"Type="Deformable_Object"Prefix="simulation/path"Shader="Shadername"Smooth_Normals=bPreserve_Creases=bRange=1-5
}
![Page 52: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/52.jpg)
Rigid Bodies
List_Object{Name="str"Type="Rigid_Body_List"Prefix="simulation/path"Shader="ShaderName"Smooth_Normals=bSubdivide_Geometry=bPreserve_Creases=bRange=1,3-10
}
![Page 53: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/53.jpg)
Scene File
● Other objects● Meshes● Cylinders● Spheres
● Unsimulated objects
![Page 54: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/54.jpg)
Sphere
Object{Name="str"Type="Sphere"Position=[x y z]Radius=dShader="ShaderName"
}
![Page 55: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/55.jpg)
Triangulated Surface
Object{Name="str"Type="Triangulated_Surface"Smooth_Normals=bFilename="surface.tri.gz"Shader="ShaderName"
}
![Page 56: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/56.jpg)
Scene File
● Shaders● Colors● Textures● Transparency● Reflection● Blending
![Page 57: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/57.jpg)
Color Shader
Material{Name="str"Type="Color"Color= [r g b]
}
![Page 58: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/58.jpg)
Lambertian Shader
Material{Name="str"Type="Lambertian"Shader="ShaderName"Ambient=[r g b]Reflectivity=d
}
![Page 59: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/59.jpg)
Phong Shader
Material{Name="str"Type="Phong"Shader="ShaderName"Diffuse=[r g b]Specular=[r g b]Specular_Exponent=d
}
![Page 60: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/60.jpg)
Voxel Shader
Volume_Material{Name="SmokeShader"Type="Voxel_Shader"Absorption=iScattering=iInscattering_Amplification=i
}
![Page 61: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/61.jpg)
Transparency and Reflextion
Material{Name="str"Type="Transparent"Reflectivity=d
}
![Page 62: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/62.jpg)
Blend Shader
Material{Name="str"Type="Blend"Shader1="ShaderName1"Shader2="ShaderName2"Blend_Fraction=d
}
![Page 63: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/63.jpg)
An Example
● ./ray_tracing_pentium4 <scene> <frame>● Use the scene file for smoke
● Voxel data points to the output directory● Output path is relative
● Generates frame.<frame>.png
![Page 64: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/64.jpg)
Make Your Own
● Can now download, run, view data● Want to change simulation● PhysBAM structure
● main.cpp● TYPE_EXAMPLE.{h,cpp}● TYPE_DRIVER.{h,cpp}
![Page 65: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/65.jpg)
main.cpp
● Parse input● Creates Example
● Sets parameters
● Creates Driver● Runs simulation
![Page 66: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/66.jpg)
TYPE_EXAMPLE
● Stores Variables● Smoke density, velocity
● Adds Callbacks● Get_Boundary_Conditions
![Page 67: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/67.jpg)
TYPE_DRIVER
● Executes simulation● Advection● Forces● Projection
![Page 68: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/68.jpg)
How to Add a Sphere
● Files to modify● SMOKE_EXAMPLE{.h,.cpp}
● Use a SPHERE<TV> object● Works with other geometry
![Page 69: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/69.jpg)
How to Add a Sphere
![Page 70: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/70.jpg)
How to Simulate Particles
● Files to modify● SMOKE_EXAMPLE{.h,.cpp}● SMOKE_DRIVER.cpp
● Stored as an array of positions
![Page 71: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/71.jpg)
How to Modify the viewer
● How to add visualization● Files to modify
● main.cpp
Can use OPENGL_COMPONENTS
![Page 72: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/72.jpg)
How to Add Particles
![Page 73: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/73.jpg)
How to Add Particles
![Page 74: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/74.jpg)
PhysBAM
● PhysBAM is a code package for simulation● http://physbam.stanford.edu/
● Tools and Geometry are released● Smoke● Water● Opengl viewing● Ray Tracing
![Page 75: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/75.jpg)
Whats Next?
● Portability● Tablets, Phones
● Functionality● Meshing● Rigids● Deformables
![Page 76: PhysBAM: Physically Based Simulationphysbam.stanford.edu/~mlentine/images/physbam.pdf · The PhysBAM Release ... Solids Fluids Coupling ... ProjectionPublished in: international conference](https://reader031.vdocuments.us/reader031/viewer/2022030417/5aa32d3d7f8b9ab4208dfe3e/html5/thumbnails/76.jpg)
Thank You!