We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Set outline parameters via Javascript

Home Forums Programming Set outline parameters via Javascript


Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • #27444

    I’m trying to change outline parameters via JavaScript.

    In the “visual_logic.js”. I tried the following parameter to change the outline color but I’m getting “cannot read property ‘outlinePass’ of undefinded”.
    appInstance.postprocessing.outlinePass.visibleEdgeColor = new v3d.Vector4(0,0,1,1)

    Also I would like to know if someone could tell me the paramters to set all possible outline effects? For example “render hidden edge” or “edge strength” etc.


    Was a bit too early with writing here. Setting the outline color is working the way I described above. There was just a browser caching issue.

    So for everyone who is interested in setting outline effects via JavaScript, these are the commands:

    appInstance.postprocessing.outlinePass.visibleEdgeColor = new v3d.Vector4(0,0,1,1);
    appInstance.postprocessing.outlinePass.hiddenEdgeColor = new v3d.Vector4(0,1,0,1);
    appInstance.postprocessing.outlinePass.edgeStrength = 3;
    appInstance.postprocessing.outlinePass.edgeGlow = 0;
    appInstance.postprocessing.outlinePass.edgeThickness = 4;
    appInstance.postprocessing.outlinePass.pulsePeriod = 0;

    The only thing I could figure out, is how to set “Render Hidden Edge”. Tried it this way, but doesnt seem to have any effect:
    appInstance.postprocessing.outlinePass.renderHiddenEdge = false;

    • This reply was modified 2 years, 7 months ago by web.

    thanks for sharing your solution!

    is how to set “Render Hidden Edge”.

    this is alpha channel of hiddenEdgeColor, 0 or 1


    Chief 3D Verger | LinkedIn | Twitter


    Ah, okay. Neat hack^^


    Hello, sorry to bump this old topic.

    I have a question about the javascript part for the outline effect.
    I’m trying to use the puzzle block “exec script” where it executes the specified js code.

    Basically, I have a cube and another smaller cube hidden inside it. I’m trying via the exec script puzzle to temporally activate the “Render Hidden egdes” option when clicking on the visible cube but I cant figure out what to write exactly, even using the answer from Yuri : “appInstance.postprocessing.outlinePass.hiddenEdgeColor.setW(1);”

    nothing happens. Is there a specific way to write this?

    You must be logged in to view attached files.


    try using app instead:


    Chief 3D Verger | LinkedIn | Twitter


    Hello Yuri,
    It worked great! Thank you! :good:

    You must be logged in to view attached files.

    Hi Yuri,

    function runCode(app) {
    //some code
    app.scene.appInstance.outline(test, ‘ENABLE’);
    app.postprocessing.outlinePass.visibleEdgeColor = new v3d.Vector4(0, 0, 1, 1);

    How to enable outline and change its color outside the runCode function?
    My code structure is something like the above but enabling outline and changing its color give error.

    • This reply was modified 6 months, 1 week ago by saalemv3d.
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.