How to create transparent background in viewer

Hi. I’m struggling to force scene background to transparent in babylon js viewer for few hours.

For now, my code looks like this:

Is there any parameter that allow me to completely turn off scene background, make it transparent and display only the object that I loaded?
Thank you in advance.

Pinging @RaananW

I don’t know the viewer, but you can try:

<clear-color r="1" g="0" b="0" a="0"></clear-color>
1 Like

I tried, but clear color don’t do anything. It’s still showing default deep purple color from “extends=“minimal”” or gray gradient from “extends=“default””

Seems to work - A Pen by Raanan Weber

1 Like

You’re right.

This is what I’m getting. Maybe it’s a problem with Wordpress.

if you want to share a non-working example, we will be able to help further :slight_smile:

Now I literally copy pasted that example above and replaced the object.

You probably need to open the page for public views -

should be okay now

Seems like a few
were added to the code without any need -

 <babylon extends="minimal"><br />
            <model url="/obj/spuckschutz1.glb"><br />
                <scaling x="1" y="1" z="1"></scaling><br />
            </model><br />
            <camera><br />
                <behaviors><br />
                    <auto-rotate type="0"></auto-rotate><br />
                </behaviors><br />
            </camera><br />
          <scene><br />
        <clear-color r="1" g="0", b="0" a="0"></clear-color><br />
    </scene><br />

The parser fails (my guess is that it can’t find a top-level babylon BR object and stops). Remove those
and it will work correctly

1 Like

It was a problem with wordpress default editor (even “text” mode wasn’t enough).
Now it works. Thank you so much.
One more question. Is it possible to remove that black border around the scene (after left mouse click)?

I’m think this is the focused border css definition, but I’m not entirely sure. Check forcing the border to 0 I can check later if I can find a different solution