|
@@ -112,7 +112,6 @@
|
|
|
|
|
|
var engine = this._scene.getEngine();
|
|
var engine = this._scene.getEngine();
|
|
engine.setDepthWrite(false);
|
|
engine.setDepthWrite(false);
|
|
- engine.setColorWrite(false);
|
|
|
|
this._colorShader._preBind();
|
|
this._colorShader._preBind();
|
|
|
|
|
|
var boundingBox = mesh._boundingInfo.boundingBox;
|
|
var boundingBox = mesh._boundingInfo.boundingBox;
|
|
@@ -125,18 +124,32 @@
|
|
.multiply(Matrix.Translation(median.x, median.y, median.z))
|
|
.multiply(Matrix.Translation(median.x, median.y, median.z))
|
|
.multiply(boundingBox.getWorldMatrix());
|
|
.multiply(boundingBox.getWorldMatrix());
|
|
|
|
|
|
|
|
+ // VBOs
|
|
engine.bindBuffers(this._vertexBuffers, this._indexBuffer, <Effect>this._colorShader.getEffect());
|
|
engine.bindBuffers(this._vertexBuffers, this._indexBuffer, <Effect>this._colorShader.getEffect());
|
|
|
|
|
|
|
|
+
|
|
|
|
+ // Back
|
|
|
|
+ //engine.setDepthFunctionToGreaterOrEqual();
|
|
|
|
+ this._scene.resetCachedMaterial();
|
|
|
|
+ this._colorShader.setColor4("color", this.backColor.toColor4());
|
|
|
|
+ this._colorShader.bind(worldMatrix);
|
|
|
|
+
|
|
|
|
+ // Draw order
|
|
|
|
+ engine.drawElementsType(Material.LineListDrawMode, 0, 24);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // Front
|
|
engine.setDepthFunctionToLess();
|
|
engine.setDepthFunctionToLess();
|
|
this._scene.resetCachedMaterial();
|
|
this._scene.resetCachedMaterial();
|
|
|
|
+ this._colorShader.setColor4("color", this.frontColor.toColor4());
|
|
this._colorShader.bind(worldMatrix);
|
|
this._colorShader.bind(worldMatrix);
|
|
|
|
|
|
- engine.drawElementsType(Material.TriangleFillMode, 0, 24);
|
|
|
|
|
|
+ // Draw order
|
|
|
|
+ engine.drawElementsType(Material.LineListDrawMode, 0, 24);
|
|
|
|
|
|
this._colorShader.unbind();
|
|
this._colorShader.unbind();
|
|
engine.setDepthFunctionToLessOrEqual();
|
|
engine.setDepthFunctionToLessOrEqual();
|
|
engine.setDepthWrite(true);
|
|
engine.setDepthWrite(true);
|
|
- engine.setColorWrite(true);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
public dispose(): void {
|
|
public dispose(): void {
|