Perfectly aligning an interactive CSS3D terminal inside a curved WebGL CRT monitor

I’m not sure about the number of hoops you jumped through to get the punchthru tho?

Can’t you just render the monitors screen mesh into the punchthru alpha to show through to your CSSRenderer behind the WebGL canvas?

the css3d-mixed sample also shows this.. notice at oblique angles, the boxy picture frame properly occludes the CSS content.

The key insight being that the CSSRenderer is placed behind the (webgl canvas with alpha=true)

edit: hahah found my earliest reference to it from 13 years ago!! :

and some potential pitfalls to watch out for:

Also.. as an extension to this.. you can also put another CSS layer on top of everything if you want something with nice transparency / blending but no occlusion… or using the punchthru for occlusion, but limited blending/transparency.

2 Likes