• RuntimesUnity
  • Help with SkeletonGraphicRenderTexture Force Aspect Ratio

Hi, I'm currently Unity 6 with Spine 4.3 beta runtime.

I am currently using SkeletonGraphicRenderTexture to do a fade effect. The problem is I have a force aspect ratio asset that keeps the ratio at 16:9, currently using https://assetstore.unity.com/publishers/19693. (I have tried force aspect ratio scripts with the same problem). The canvas is using screen space - camera, with reference resolution 1920 x 1080, match width or height mode, height 1.

So when the game is using 16:9 aspect ratio, everything works fine, but when the ratio is different the the texture moves/clips

Here is working normal version 16:9 ratio

Here is 16:10 ratio

Here is is 4:3 ratio

Here is is 4:3 ratio with SkeletonGraphicRenderTexture Off

As you can see SkeletonGraphic works fine and resize correctly with the force aspect ratio but whenever I enabled SkeletonGraphicRenderTexture, the clipping happens. I checked and it also happens to SkeletonRenderTexture.

Any advice on how to proceed is greatly appreciated.

Related Discussions
...

The issue you're experiencing with SkeletonGraphicRenderTexture and aspect ratio clipping is likely related to how the render texture is being managed when the aspect ratio changes. This can happen because the render texture might not be adjusting its size or position correctly when the aspect ratio is forced to something other than 16:9.

One potential solution is to ensure that the render texture's size and position are updated whenever the aspect ratio changes. You might need to manually adjust the render texture's properties in response to changes in the screen size or aspect ratio. This can be done by listening to screen size changes and recalculating the render texture's dimensions and position accordingly.

Additionally, you should verify that the SkeletonGraphicRenderTexture component is set up to handle different aspect ratios. This might involve checking the component's settings or modifying the script to ensure it dynamically adjusts to the current screen dimensions.

If these adjustments do not resolve the issue, consider checking if there are any updates or patches for the SkeletonGraphicRenderTexture component in the Spine 4.3 beta runtime that address aspect ratio handling.

@BillyBoBo The render texture object might have been added to the scene with different RectTransform settings or layout options than your original SkeletonGraphic object. Could you please check both RectTransforms whether they differ?

    Harald

    They are a little different in Pos Y.
    SkeletonGraphic Pos Y = 0

    GraphicRenderTexture display window 4:3 ratio but forced 16:9, Pos Y = 0
    GraphicRenderTexture display window 16:9 ratio but forced 16:9, Pos Y = -6
    GraphicRenderTexture display window 16:10 ratio but forced 16:9, Pos Y = -6

    GraphicRenderTexture window 16:9 ratio but forced 16:9, Pos Y = -6 is the one that works fine even though Pos Y = -6.

    @Harald

    Thanks for the help Harald. I was able to get it working. I just had to offset the screenSpaceMin,Max with my targetCamera

    @BillyBoBo Glad to hear, thanks for getting back to us.