Tresjs / lab

Showcase and examples lab for TresJS
https://lab.tresjs.org/
69 stars 12 forks source link

Good morning everynyan. How to change background to transparent #81

Closed Tonight11 closed 9 months ago

Tonight11 commented 10 months ago

So there is my code. And my canvas has black background and i wanna change it to transparent but it doesnt work. PLS HELP😿

WangShuan commented 9 months ago

@Tonight11 Hi, I noticed there's no template code provided, but if you're looking to make the background of TresCanvas transparent, you can try the following:

<TresCanvas alpha window-size>
<TresCanvas clear-color="#00000000" window-size>

Way 1. Set clear-color to #00000000. Way 2. Add alpha to the TresCanvas tag and remove clear-color setting.

This approach seems feasible, but I'm not entirely certain if it is correct. Hope this helps! 😊