portal-render-target-windows
Installation
SKILL.md
Render Target Portal Windows
What this builds
A portal implemented as a texture: a second camera renders another scene into a WebGLRenderTarget,
and that target is sampled by a material on the portal surface. The result is a framed window into
another world that composes cleanly with post-processing, supports blur and distortion on the
portal surface itself, and can be blended or animated as an ordinary texture.
- Any surface shape via UV mapping or an alpha mask
- Correct perspective from the viewer's position, not a flat billboard
- Post-processing on the portal contents independently of the main scene
- Smooth open and close transitions by blending the target
- R3F path using drei
MeshPortalMaterial, and a vanilla path