You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make it possible to configure the background to be transparent #874
Sorry if this is not a relevant question but I couldn't find anything regarding this topic on the documentation/Internet. Is it possible to set the background-color attribute of to transparent/ none? It appears to default to a white background if the CSS string is not parsed correctly.
@ethanny2 yes, we would like for this to be possible. It's a trickier problem than it seems, because it requires that we enable alpha: true when creating the WebGL context, which in turn can have negative consequences for alpha blending in the scene.
So, all that to say I think we should support this but it needs to be opt-in.
changed the title [-]Possible to set Transparent/ No background color for <model-viewer>?[/-][+]Make it possible to configure the background to be transparent[/+]on Nov 5, 2019
To add another usecase for this, Shopify allows merchants to specify the background colour over the model-viewer. However the poster image always gets generated with a white background. So if the background colours are different, you'll notice it when it transitions from poster -> 3D. It would be nice if we could generate the poster image as a png with a transparent background, that way we could seamlessly transition to the 3D model regardless of background color.
Activity
forresto commentedon Nov 5, 2019
Demo PR here, but it's WIP: #268 ... conversation: #182
cdata commentedon Nov 5, 2019
@ethanny2 yes, we would like for this to be possible. It's a trickier problem than it seems, because it requires that we enable
alpha: truewhen creating the WebGL context, which in turn can have negative consequences for alpha blending in the scene.So, all that to say I think we should support this but it needs to be opt-in.
[-]Possible to set Transparent/ No background color for <model-viewer>?[/-][+]Make it possible to configure the background to be transparent[/+]pushmatrix commentedon Dec 4, 2019
To add another usecase for this, Shopify allows merchants to specify the background colour over the model-viewer. However the poster image always gets generated with a white background. So if the background colours are different, you'll notice it when it transitions from poster -> 3D. It would be nice if we could generate the poster image as a png with a transparent background, that way we could seamlessly transition to the 3D model regardless of background color.
matiasnombarasco commentedon Dec 18, 2019
Having this feature will help us a lot, currently, I haven't found any walkaround this behavior, so I can't this web component.