Stroke/ outline on selected mesh with an Alt text

How do we give stroke/ outline effect on a particular mesh with an Alt text, on mouse hover?

var OutlineLayer = pc.createScript('outlineLayer');

// initialize code called once per entity
OutlineLayer.prototype.initialize = function() {

// update code called every frame
OutlineLayer.prototype.update = function(dt) {
    var outlineSelector ='meshMito');
        outlineSelector.forEach(function (node){
            node.enabled = true;
                const outline = new OutlineEffect(app.graphicsDevice, 3);
                    outline.color = new pc.Color(0, 13, 5, 1);
                    outline.texture = texture;


Hi @devstu,

The way the outline post effect works is you initialize it once and then you add a custom pc.Layer from any model you would like the effect to render on.

Check this engine example on how that works:


I’ll check this out.