Nonlinear Stretch
#16
(2012-08-04, 22:50)bobo1on1 Wrote: Congratulations on your excellent feature request, you've just requested something that has been available in XBMC for over two years.
Now that's quick service or what Rofl
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#17
@mbrickman: Perhaps your source of information is wrong, and the dev knew what he was talking about? From the code:

Code:
else if ( g_settings.m_currentVideoSettings.m_ViewMode == VIEW_MODE_WIDE_ZOOM ||
           (is43 && g_guiSettings.GetInt("videoplayer.stretch43") == VIEW_MODE_WIDE_ZOOM))
  { // super zoom
    float stretchAmount = (screenWidth / screenHeight) * g_settings.m_ResInfo[res].fPixelRatio / sourceFrameRatio;
    g_settings.m_fPixelRatio = pow(stretchAmount, float(2.0/3.0));
    g_settings.m_fZoomAmount = pow(stretchAmount, float((stretchAmount < 1.0) ? -1.0/3.0 : 1.0/3.0));
    g_settings.m_bNonLinStretch = true;
  }

I'd appreciate if you could pop onto the wiki (or wherever you found it) and update it.

Thanks,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#18
The transform itself is done in a glsl shader:

Code:
// our transform should map [0..1] to itself, with f(0) = 0, f(1) = 1, f(0.5) = 0.5, and f'(0.5) = b.
  // a simple curve to do this is g(x) = b(x-0.5) + (1-b)2^(n-1)(x-0.5)^n + 0.5
  // where the power preserves sign. n = 2 is the simplest non-linear case (required when b != 1)
  float x = pos.x - 0.5;
  return vec2(mix(x * abs(x) * 2.0, x, m_stretch) + 0.5, pos.y);

With the m_stretch variable, XBMC can set the distortion between quadratic and linear.
Reply
#19
Also, key point of bobo1on1's earlier post: as the glsl shader is what does it, if you're using win32 you don't get this neatness.

With that said, it should be relatively simple to translate the existing glsl into d3d, so if someone has the requisite time and motivation, see system/shaders.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#20
I would love to see this non-linear stretch on the Windows platform! I'll go see if there's a feature request out there for it yet.

It looks like there is a feature request out there for this on "All" platforms. It's been already discussed in the comments getting it ported to DirectX too - by jmarshall. Currently only Linux though?
Quick Links: debug log (wiki) | userdata (wiki) | advancedsettings (wiki) | adding videos to the library (wiki)
Reply

Logout Mark Read Team Forum Stats Members Help
Nonlinear Stretch0