Help.. How to hide Chromakey in this project?


I’m trying to do chromakey … I found this project in playcanvas where a material is fed with a video and a glsl shader is added to eliminate the green zones.
OK perfect. Now I try to do it directly from a camera with RenderTexture. I also added the glsl shader and apparently there is no error in the console, but it just does not happen.

This is the Code i use `/////////////////////// RenderLayerToTexture /////////////////////////////////
var RenderLayerTotexture = pc.createScript(‘renderLayerTotexture’);

RenderLayerTotexture.attributes.add(‘shader’, {type:‘asset’, assetType : ‘shader’});

RenderLayerTotexture.attributes.add(‘layerName’, { type : ‘string’});

RenderLayerTotexture.prototype.initialize = function() {
///////// depth buffer
var colorBuffer = new pc.Texture(, {
width: 512,
height: 512,
format: pc.PIXELFORMAT_R8_G8_B8,
autoMipmap: true
colorBuffer.minFilter = pc.FILTER_LINEAR;
colorBuffer.magFilter = pc.FILTER_LINEAR;
var renderTarget = new pc.RenderTarget(, colorBuffer, {
depth: true

var layer =;
layer.renderTarget = renderTarget;


`. Thanks. The link.




Suggestions gor me?.. Thanks