Changing jit.world size without affecting aspect ratio

Little-P's icon

Hello Everyone!

I have a problem, which i do not understand - this behaviour makes no sense to me.

My Problem:

  • i play a video into a jit.gl.videoplane with preserve_aspect = 1

  • this texture is send to my world object

  • without changing the dim values of my world object, but changing the size of it the aspect ratio of my incoming texture stays the same

  • when changing the dim values and then changing the size values the aspect ratio changes

  • reinitializing the jit.world object allowes changing the size again without changing the aspect ratio

What do i don't get here?

I want my texture to be displayed always in the incoming aspect ratio indepedent of the dim and size values of the world object.

here a minimal example

Max Patch
Copy patch and select New From Clipboard in Max.

TFL's icon

It does look like a bug to me.

Hopefully Rob Ramirez will see this.

Or maybe fill a ticket.

In the meantime you can scale the videoplane by yourself, although the result isn't exactly the same (it won't always fit in the output).

Max Patch
Copy patch and select New From Clipboard in Max.

Little-P's icon

Thanks for your response!

I already thought about that this could be a bug, but since i'm not that well educated around the jitter environment, i thought, i did not get something.

I filled a ticket and hope that this can be fixed soon.

Rob Ramirez's icon

I'm not sure what your goal is. If you want to change the size of the jit.world window and keep the aspect_ratio then just use the jit.world size attribute (or resize the window manually with mouse).

Do you want a decoupled jit.world dim and size? meaning your windows size is not equal to the capture texture dimensions? As soon as you set a jit.world dim attribute, this decoupling happens and the preserve_aspect will preserve to that dim aspect rather than the windows size aspect (since that dim is the actual dim of the surface you are rendering to).

So unless there's a particular reason to, I would leave dim alone and the aspect ratio will be correct. If there is a particular reason, then I'd recommend using a jit.gl.node @capture 1 @adapt 0 instead

Max Patch
Copy patch and select New From Clipboard in Max.

Little-P's icon

Thanks Rob! This solved my problem!

Do i understand this right:

when i decouple size and dim and resize the window the pixels are getting "squeezed" to the size of the window and since so my output is also "squeezed"?

My goal was to create a patch, that will stream the right resolution to a syphon client, where i wanted to record the output in my wanted resolution but also check my output in my patch and if my machine can perform streaming und rendering in this resolution.

Little-P's icon

I have another thing that confuses me, but has probably also to do with a similiar problem:

i did set up a bus logic for rendering and mixing several textures. in this example there is only one right now but describes the problem. my incoming texture to outBus is getting cropped and i don't get why.

can someone explain why and how to avoid this?

Max Patch
Copy patch and select New From Clipboard in Max.

Rob Ramirez's icon

sorry, it's still not clear what you want.

In your patch you are playing a 16:9 aspect ratio video into a videoplane with preserve aspect enabled. That aspect preservation is in relation to both the incoming texture aspect ratio (16:9), and the drawing surface aspect ratio.

In this case the chickens videoplane is drawing to a capturing node called "mixerBus", and so what is the dim of that capturing node? well since adapt is 0 on that node we check what the dim is set to, and since there is no explicit value for the dim it's set to the default of 515x512. Hooking a jit.fpsgui up to the mixerBus-node and indeed that output is 515x512, and looking at that output with a pwindow with a square aspect ratio, we see the videoplane does indeed preserve the aspect ratio of it's input relative to this surface, and the video is undistorted. however you are scaling that videoplane by 2, and so it is cropping out on the capturing surface.

Then this square surface with it's cropped out chickens is being sent to another videoplane with preserve_aspect enabled, which is then drawing to another capturing node surface, this time with explicit dims at an entirely different aspect ratio, and hopefully it's clear now why you're seeing what you're seeing.

happy to help you sort out a solution, but you'll need to describe exactly you want.