Clears a p5.Geometry object from the graphics processing unit (GPU) memory.
p5.Geometry objects can contain lots of data about their vertices, surface normals, colors, and so on. Complex 3D shapes can use lots of memory which is a limited resource in many GPUs. Calling freeGeometry() can improve performance by freeing a p5.Geometry object’s resources from GPU memory. freeGeometry() works with p5.Geometry objects created with beginGeometry() and endGeometry(), buildGeometry(), and loadModel().
The parameter, geometry, is the p5.Geometry object to be freed.
Note: A p5.Geometry object can still be drawn after its resources are cleared from GPU memory. It may take longer to draw the first time it’s redrawn.
Note: freeGeometry() can only be used in WebGL mode.
예제
구문
freeGeometry(geometry)
매개변수
3D shape whose resources should be freed.
관련 레퍼런스
beginGeometry
Begins adding shapes to a new p5.Geometry object.
buildGeometry
Creates a custom p5.Geometry object from simpler 3D shapes.
endGeometry
Stops adding shapes to a new p5.Geometry object and returns the object.
freeGeometry
Clears a p5.Geometry object from the graphics processing unit (GPU) memory.