Skip to content

Commit 8e92eed

Browse files
committed
Move vertex pulling flag to material
1 parent 12d9fcf commit 8e92eed

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

packages/dev/core/src/Materials/material.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,12 @@ export class Material implements IAnimatable, IClipPlanesHolder {
239239

240240
protected _forceGLSL = false;
241241

242+
/**
243+
* Tells the engine to draw geometry using vertex pulling instead of index drawing. This will automatically
244+
* set the vertex buffers as storage buffers and make them accessible to the vertex shader.
245+
*/
246+
public useVertexPulling = false;
247+
242248
/** @internal */
243249
public get _supportGlowLayer() {
244250
return false;

packages/dev/core/src/Meshes/abstractMesh.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -956,9 +956,6 @@ export abstract class AbstractMesh extends TransformNode implements IDisposable,
956956
/** @internal */
957957
public _unIndexed = false;
958958

959-
/** @internal */
960-
public _useVertexPulling = false;
961-
962959
/** @internal */
963960
public _lightSources = new Array<Light>();
964961

packages/dev/core/src/Meshes/mesh.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2054,14 +2054,15 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
20542054

20552055
const scene = this.getScene();
20562056
const engine = scene.getEngine();
2057+
const material = subMesh.getMaterial();
20572058

20582059
if ((this._unIndexed && fillMode !== Material.WireFrameFillMode) || fillMode == Material.PointFillMode) {
20592060
// or triangles as points
20602061
engine.drawArraysType(fillMode, subMesh.verticesStart, subMesh.verticesCount, this.forcedInstanceCount || instancesCount);
20612062
} else if (fillMode == Material.WireFrameFillMode) {
20622063
// Triangles as wireframe
20632064
engine.drawElementsType(fillMode, 0, subMesh._linesIndexCount, this.forcedInstanceCount || instancesCount);
2064-
} else if (this._useVertexPulling) {
2065+
} else if (material && material.useVertexPulling) {
20652066
// We're rendering the number of indices in the index buffer but the vertex shader is handling the data itself.
20662067
engine.drawArraysType(fillMode, subMesh.indexStart, subMesh.indexCount, this.forcedInstanceCount || instancesCount);
20672068
} else {

0 commit comments

Comments
 (0)