Hello @Mirko_Arcese!
I’ve created a sample project to test this out: PlayCanvas | HTML5 Game Engine
There are a few things to look out for, glossiness needs to be fairly high for refractions to shine through as the material would otherwise act more as a diffuser than a sheet of glass.
A valid setup for the material can look like this:
Note that under Opacity, the material is set to do alpha blending. This isn’t really to do so much with the actual blending as it is putting the object being rendered into the transparent layer.
The camera also needs to have a script on it, which is very simple but it’s needed to enable the color grabpass.
var Grabpass = pc.createScript('grabpass');
// initialize code called once per entity
Grabpass.prototype.initialize = function() {
entity.camera.camera.requestSceneColorMap(true);
};
// update code called every frame
Grabpass.prototype.update = function(dt) {
};
A note on this is that the script is only necessary to enable refractions when playing the game. It should already be working in the viewport in the editor.
The last thing that needs to be done is to set the canvas to render transparently. This is really a bug in the engine that we plan to fix very soon, but for the time being it’s necessary to set that flag for this to work.