Skip to content

v1.56.0

Compare
Choose a tag to compare
@GSterbrant GSterbrant released this 30 Aug 14:36

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)
        });