Hi all, I’m new to Babylon JS and the forums so please let me know if I’m doing something wrong
I’m attempting to use the BABYLON.VolumetricLightScatteringPostProcess
to create some light shafts, as shown in this playground example: Babylon.js Playground
I have copied the code straight out of this example, apart from the variable names, and placed it into my scene. This is the result:
The white square nestled in the leaves of the tree is the default billboard of the VolumetricLightScatteringPostProcess
. However, instead of having a glow like in the example above, it is just a blank square.
Here is the section of my code invoking this process for reference:
// Volumetric Lighting.
let volumetric_light = new BABYLON.VolumetricLightScatteringPostProcess('volumetric_light', 1.0, camera, undefined, 100, BABYLON.Texture.BILINEAR_SAMPLINGMODE, engine, false, scene);
volumetric_light.mesh.position = new BABYLON.Vector3(7, 25, 20);
volumetric_light.mesh.scaling = new BABYLON.Vector3(10, 10, 10);
And here are the parameters I’m using to construct my engine, scene, and camera:
// Engine.
let engine = new BABYLON.Engine(canvas, true, { preserveDrawingBuffer: true, stencil: true });
// Scene.
let scene = new BABYLON.Scene(engine);
// Camera.
let camera = new BABYLON.ArcRotateCamera(
"arc_cam", // Name.
Math.PI / 2, // Alpha.
Math.PI / 2, // Beta.
6, // Radius.
new BABYLON.Vector3(-1.2, 12, 40), // Target.
scene // Scene.
);
camera.lowerRadiusLimit = 6;
camera.upperRadiusLimit = 6;
camera.lowerAlphaLimit = Math.PI / 2.9;
camera.upperAlphaLimit = Math.PI / 1.55;
camera.lowerBetaLimit = Math.PI / 2.4;
camera.upperBetaLimit = Math.PI / 1.75;
After a couple hours of googling, I’ve turned up no useful answers to this problem.
Has anyone else encountered this same issue? Does anyone know how to fix this?
Please let me know if you need any more information.
Any advice would be greatly appreciated, thanks!