Home › Forums › General Questions › Switch to Transparent Background on the fly
- This topic has 6 replies, 2 voices, and was last updated 2 years, 9 months ago by Yuri Kovelenov.
-
AuthorPosts
-
2022-02-03 at 1:13 pm #48997CrunchCustomer
I know that in the init tab there is a “config application” puzzle where I can set the background to render transparent. However, if there is a way to make it transparent on the fly via code? (eg, not at initial setup)
Bonus points if this transparency tweak could also be animated so it could fade in/out to transparency.
Why I ask is the effect I am looking for is to have my scene, which starts with a visible HDRI background (a open sky scene). Later on in the scene, I would like to code an event where the background HDRI fades out (to transparent) so the background HTML (which has a video set as background) then shows – while the objects in my scene remain visible.
2022-02-03 at 3:09 pm #49008Yuri KovelenovStaff2022-02-04 at 4:38 am #49019CrunchCustomerThanks Yuri but I am still puzzled.
To clarify, I am using an HRDI as the background and lighting. I align a plane with the HDR so the clouds/sky land on the horizon.
The effect I would like to trigger is to have the HDR go blank (transparent), just like if I had the “advanced World nodes setup based on Is Camera Ray output”. But if I use that setup, it defeats the point as I lose the clouds that I want to be part of the scene at the start of the app.
Why I want to do this, is because I have a html video element (a mp4 video of clouds/thunderstorm) in the background of the web page, that I would like to be exposed (essentially hiding/masking out the clouds from the static HDRI scene so the html background video shines through)
I’ve experimented trying to slide a video texture/plane into place so its perpendicular to the ground plane, but video textures seem very expensive versus a flat html based video.
Any ideas on how this effect could be pulled off? Thanks!
Attachments:
You must be logged in to view attached files.2022-02-04 at 9:28 am #49027Yuri KovelenovStaff2022-02-04 at 4:04 pm #49072CrunchCustomerBe a whole lot cooler if I could just change the transparency setting on the fly but everything I’ve seen on three.js seems the render has to either be transparent or not at initialization only.
So I have done clouds on a sphere before (just like in the farmers journey demo). Which is just fine for a cartoon-ey like scenes. But how could I get a higher fidelity graphic that wraps to the sphere without distortion like the envior HDRIs do?
You did something similar in the Global Illumination demo with the canal shot but that was more of a half sphere and I am looking for it wrap full sphere.
How do I accomplish this?
2022-02-04 at 4:11 pm #49073CrunchCustomerah, I suppose I’ve never tried applying an hdri to sphere.. just did it is looking good! have a good weekend yuri! thanks
2022-02-05 at 4:57 am #49077Yuri KovelenovStaff -
AuthorPosts
- You must be logged in to reply to this topic.