Playground: Babylon.js Playground
In the Playground, the following is fine:
// This creates a basic Babylon Scene object (non-mesh)
var scene = new BABYLON.Scene(engine);
// This creates and positions a free camera (non-mesh)
var camera = new BABYLON.FreeCamera("camera1", new BABYLON.Vector3(0, 5, -10), scene);
const ssr = new BABYLON.SSRRenderingPipeline
(
"ssr", // The name of the pipeline
scene, // The scene to which the pipeline belongs
[scene.activeCamera], // The list of cameras to attach the pipeline to
false, // Whether or not to use the geometry buffer renderer (default: false, use the pre-pass renderer)
BABYLON.Constants.TEXTURETYPE_UNSIGNED_BYTE, // The texture type used by the SSR effect (default: TEXTURETYPE_UNSIGNED_BYTE)
);
But in my own project, even though the scene is properly initialized, the console returns ‘Uncaught TypeError: scene.enablePrePassRenderer is not a function’ inside the constructor of the SSRRenderingPipeline.
I have tried creating a brand new scene with no additional parameters, and toggling the froceGeometryBuffer parameter in the constructor, but none of those worked. It seems the constructor doesn’t recognize the scene, even though I can manually call that method myself.
I have no idea what could be causing this.