Browse Source

updating what's new + only using GBR for not prepass compatible materials

Benjamin Guignabert 4 years ago
parent
commit
bf224b4a78

+ 6 - 0
dist/preview release/what's new.md

@@ -35,6 +35,7 @@
 ### Materials
 
 - Added an `OcclusionMaterial` to simplify depth-only rendering of geometry ([rgerd](https://github.com/rgerd))
+- PrePass can now be used in `RenderTargets` speeding up effects like SSAO2 or MotionBlur ([CraigFeldspar](https://github.com/CraigFeldspar))
 
 ### Inspector
 
@@ -82,6 +83,11 @@
 - Fix canvas not resized correctly in a multi-canvas scenario ([Popov72](https://github.com/Popov72))
 - Fix NaN values returned by `GetAngleBetweenVectors` when vectors are the same or directly opposite ([Popov72](https://github.com/Popov72))
 - Fix 404 occurring on some pictures in some cases when using particle systems ([Popov72](https://github.com/Popov72))
+- Fix PrePass bugs with transparency ([CraigFeldspar](https://github.com/CraigFeldspar))
+- Fix PrePass bugs with layers ([CraigFeldspar](https://github.com/CraigFeldspar))
+- Fix SSAO2 with PrePass sometimes causing colors brighter than they should be ([CraigFeldspar](https://github.com/CraigFeldspar))
+- Fix PostProcess sharing between cameras/renderTargets, that would create/destroy a texture on every frame ([CraigFeldspar](https://github.com/CraigFeldspar))
+
 
 ## Breaking changes
 

+ 7 - 0
src/Materials/PBR/pbrBaseMaterial.ts

@@ -888,6 +888,13 @@ export abstract class PBRBaseMaterial extends PushMaterial {
     }
 
     /**
+     * Can this material render to prepass
+     */
+    public get isPrePassCapable(): boolean {
+        return true;
+    }
+
+    /**
      * Gets the name of the material class.
      */
     public getClassName(): string {

+ 7 - 0
src/Materials/material.ts

@@ -481,6 +481,13 @@ export class Material implements IAnimatable {
     }
 
     /**
+     * Can this material render to prepass
+     */
+    public get isPrePassCapable(): boolean {
+        return false;
+    }
+
+    /**
      * Specifies if depth writing should be disabled
      */
     @serialize()

+ 7 - 0
src/Materials/standardMaterial.ts

@@ -597,6 +597,13 @@ export class StandardMaterial extends PushMaterial {
     public readonly prePassConfiguration: PrePassConfiguration;
 
     /**
+     * Can this material render to prepass
+     */
+    public get isPrePassCapable(): boolean {
+        return true;
+    }
+
+    /**
      * Gets wether the color curves effect is enabled.
      */
     public get cameraColorCurvesEnabled(): boolean {

+ 1 - 1
src/Rendering/prePassRenderer.ts

@@ -258,7 +258,7 @@ export class PrePassRenderer {
 
                 if (this._geometryBuffer && this.currentRTisSceneRT) {
                     const material = subMesh.getMaterial();
-                    if (material && this.excludedMaterials.indexOf(material) === -1) {
+                    if (material && !material.isPrePassCapable && this.excludedMaterials.indexOf(material) === -1) {
                         this._geometryBuffer.renderList!.push(subMesh.getRenderingMesh());
                     }
                 }