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.

Hide background programmatically

Home Forums Programming Hide background programmatically

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #23676
    mugga
    Participant

    Hey guys,
    I’m starting my first “real” project with verge3d. I’m planning to work only code based instead of using puzzles as I have to work with realtime data and I would like to do all the stuff in javascript and just pass the variables over to verge.

    I try to study the puzzle generated javascript to learn the proper usage of the functions. At the moment I struggle to just hide the HDRI background of the gltf.

    I added these to the app.loadscene:

    
    app.clearBkgOnLoad = true;
    app.renderer.setClearColor(0x000000, 0);
    app.scene.background = null;
    

    The background is then hidden but everything is black. What am I doing wrong?

    #23687

    Hi,

    this line explicitly sets the background to black:

    app.renderer.setClearColor(0x000000, 0);

    do you need it to be transparent? you can check out how the configure app puzzle does that.

    Chief 3D Verger | LinkedIn | Twitter

    #23700
    mugga
    Participant

    Yeah, I wanted it to be transparent. I forgot to set “alpha = true” for the v3d.app.
    Got it now working

    #23711

    glad you worked it out! :good:

    Chief 3D Verger | LinkedIn | Twitter

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.