jagenjo / webglstudio.js

A full open source 3D graphics editor in the browser, with scene editor, coding pad, graph editor, virtual file system, and many features more.
MIT License
5.22k stars 606 forks source link

transparent background #15

Closed HubertOehm closed 7 years ago

HubertOehm commented 9 years ago

Hi!

Congratulations to WebGLStudio! Very impressive work!

Is it possible to make the background of a scene transparent? I want to composite 3d object I am building with WebGLStudio on top of web pages.

Hubert

jagenjo commented 9 years ago

Thanks!

Right now no, you can't because I create the WebGLContext without alpha but I will consider it for the next version.

HubertOehm commented 9 years ago

Wow! Thanks for the quick reply.

Yeah, I thought that this would be the case. Thank you for considering this feature.

Best regards, Hubert

On Monday, 26 October 2015, Javi Agenjo notifications@github.com wrote:

Thanks!

Right now no, you can't because I create the WebGLContext without alpha but I will consider it for the next version.

— Reply to this email directly or view it on GitHub https://github.com/jagenjo/webglstudio.js/issues/15#issuecomment-151067776 .

jjkilpatrick commented 7 years ago

Any update on this @jagenjo?

jagenjo commented 7 years ago

The problem is that using alpha in the context would mean the performance is a little slower, and this feature is not widely used.

However, when creating the LS.Player you can pass the property: { alpha: true, premultipliedAlpha: false } so it will have the transparency on. This means that only will work in your environment, not in the editor.

But now I realized that you will need to set up the camera alpha to 0, which I never considered, so I had added a checkbox in the camera options to set the alpha to 0 (Bg.Alpha)

Just uploaded a version, you can test it latest: http://webglstudio.org/latest/

Sorry for the delay.

jjkilpatrick commented 7 years ago

Thanks for such a speedy reply. I'll give it a test now