浏览代码

right ordering

Benjamin Guignabert 4 年之前
父节点
当前提交
1eec429ebb
共有 2 个文件被更改,包括 7 次插入5 次删除
  1. 3 3
      src/Rendering/prePassRendererSceneComponent.ts
  2. 4 2
      src/sceneComponent.ts

+ 3 - 3
src/Rendering/prePassRendererSceneComponent.ts

@@ -100,8 +100,8 @@ export class PrePassRendererSceneComponent implements ISceneComponent {
         this.scene._beforeCameraDrawStage.registerStep(SceneComponentConstants.STEP_BEFORECAMERADRAW_PREPASS, this, this._beforeCameraDraw);
         this.scene._afterCameraDrawStage.registerStep(SceneComponentConstants.STEP_AFTERCAMERADRAW_PREPASS, this, this._afterCameraDraw);
         this.scene._beforeClearStage.registerStep(SceneComponentConstants.STEP_BEFORECLEARSTAGE_PREPASS, this, this._beforeClearStage);
-        this.scene._beforeRenderingMeshStage.registerStep(SceneComponentConstants.STEP_BEFORECLEARSTAGE_PREPASS, this, this._beforeRenderingMeshStage);
-        this.scene._afterRenderingMeshStage.registerStep(SceneComponentConstants.STEP_BEFORECLEARSTAGE_PREPASS, this, this._afterRenderingMeshStage);
+        this.scene._beforeRenderingMeshStage.registerStep(SceneComponentConstants.STEP_BEFORERENDERINGMESH_PREPASS, this, this._beforeRenderingMeshStage);
+        this.scene._afterRenderingMeshStage.registerStep(SceneComponentConstants.STEP_AFTERRENDERINGMESH_PREPASS, this, this._afterRenderingMeshStage);
     }
 
     private _beforeCameraDraw() {
@@ -136,7 +136,7 @@ export class PrePassRendererSceneComponent implements ISceneComponent {
 
     private _afterRenderingMeshStage(mesh: AbstractMesh) {
         const scene = mesh.getScene();
-        
+
         if (scene.prePassRenderer) {
             scene.prePassRenderer.restoreAttachments();
         }

+ 4 - 2
src/sceneComponent.ts

@@ -53,9 +53,11 @@ export class SceneComponentConstants {
 
     public static readonly STEP_BEFORERENDERTARGETDRAW_LAYER = 0;
 
-    public static readonly STEP_BEFORERENDERINGMESH_OUTLINE = 0;
+    public static readonly STEP_BEFORERENDERINGMESH_PREPASS = 0;
+    public static readonly STEP_BEFORERENDERINGMESH_OUTLINE = 1;
 
-    public static readonly STEP_AFTERRENDERINGMESH_OUTLINE = 0;
+    public static readonly STEP_AFTERRENDERINGMESH_PREPASS = 0;
+    public static readonly STEP_AFTERRENDERINGMESH_OUTLINE = 1;
 
     public static readonly STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW = 0;
     public static readonly STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER = 1;