Rotating Letterbox Effect?

Post Reply
  • Author
  • Message
Offline
User avatar
*sensei*
Posts: 391
Joined: 03 Oct 2012, 06:12
Location: Ottawa, Canada

Rotating Letterbox Effect?

As it stands, based on the code below, the letterbox is such that the top and bottom of the screen have black bars to give it that effect, but I'd like to rotate the black bars using the center of the screen as a reference.

//--
float offset= LetterBoxSize * 0.01;
float2 uv = IN.txcoord.xy;
if (uv.y <= offset || uv.y >= (1.0 - offset))
res.xyzw = 0.0;
//--

Cheers,

ZK
_________________
Intel Core i9 10900K @4.9GHz | ASUS ROG Strix Z490-G | NVIDIA - EVGA RTX 2080 XC Ultra | 32GB DDR4 Corsair Vengeance RGB PRO | 2x ADATA XPG SX8200 Pro 1TB

Flickr
Twitter

Offline
User avatar
*blah-blah-blah maniac*
Posts: 17427
Joined: 27 Dec 2011, 08:53
Location: Rather not to say

Re: Rotating Letterbox Effect?

Its not that simple, because after rotation you will have aliased lines which must be fixed. So the fastest way is to use texture as mask and rotate it, rather than rasterise antialiased line via code.
_________________
i9-9900k, 64Gb RAM, RTX 3060 12Gb, Win7
Post Reply