Hello Guest

Author Topic: Anchored Viewport Clipping Legacy  (Read 3211 times)

richicon

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 9
    • View Profile
Anchored Viewport Clipping Legacy
« on: May 08, 2014, 09:51:14 am »
Hi
I'm using Anchored Viewport Clipping to clip the bounds of a pixel perfect camera when its displayed in a higher resolution.
I notice its legacy and will be removed, how should I be doing this instead.

I have a pixel perfect resolution of 960x540
If its displayed on a 1024x768 screen I want a 960x540 image in the middle with black borders around.
without the clipping bits of the level outside this region are displayed.
if I set the clipping width and height to 960x540 it displays correctly.

I could find no other way of doing this apart from writing my own code to set the viewport rect based on resolution.
thanks
Rich

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Anchored Viewport Clipping Legacy
« Reply #1 on: May 08, 2014, 04:20:09 pm »
The absolute easiest way to do this is to make a big black solid object (drawn first) with a 960x540 hole in it. Easiest to create with 4 scaled black (make sure its using a solid shader using material overrides) rectangular sprites. You don't need to do anything else really, being solid it will write into depth and stuff behind it will be culled and wont cause any major overhead.

richicon

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Anchored Viewport Clipping Legacy
« Reply #2 on: May 16, 2014, 12:25:58 pm »
Hi, just to let you know that worked nicely and avoided some of the nasty offsets of using the viewport clipping :)