github playcanvas/engine v1.56.0

latest releases: v1.71.5, v1.71.4, v1.71.3...
2 years ago

Larger Features

What's new

Bug Fixes

New Contributors

Full Changelog: v1.55.0...v1.56.0

Notes

To enable the new dynamic refractions, a few modifications are required on the application side, first, you need to add this:

            const depthLayer = app.scene.layers.getLayerById(pc.LAYERID_DEPTH);
            app.scene.layers.remove(depthLayer);
            app.scene.layers.insertOpaque(depthLayer, 2);

What this does is to rearrange the layers such that the skydome will be part of the grab pass. Then we need to make the camera actually perform the grab pass:

            const camera = new pc.Entity();
            camera.addComponent("camera", {
                clearColor: new pc.Color(0.4, 0.45, 0.5)
            });
            camera.setLocalPosition(0, 5, 30);
            camera.camera.requestSceneColorMap(true);

The last thing to do is to make sure you create the graphics device with the alpha option set to true

        // Create the app and start the update loop
        const app = new pc.Application(canvas, {
            graphicsDeviceOptions: {
                alpha: true
            },
            mouse: new pc.Mouse(document.body),
            keyboard: new pc.Keyboard(document.body),
            touch: new pc.TouchDevice(document.body)
        });

Don't miss a new engine release

NewReleases is sending notifications on new releases.