[vlc-devel] [PATCH v3 0/8] refactor viewpoint transformation into rotation matrix

Steve Lhomme robux4 at ycbcr.xyz
Mon Mar 11 10:04:59 CET 2019


Tested successfully on Windows and merged. Thanks.

On 3/8/2019 10:35 AM, Alexandre Janniaux wrote:
> Hi,
>
> This is v3 of the patchset on viewpoint:
> v1: https://mailman.videolan.org/pipermail/vlc-devel/2019-February/122774.html
> v2: https://mailman.videolan.org/pipermail/vlc-devel/2019-March/123282.html
>
> It refactors the generation of the rotation matrix in both opengl and d3d11
> video output and avoid doing the matrix multiplication for each vertex in the
> shaders.
>
> My final goal behind is also to provide quaternion inside vlc_viewpoint_t
> instead of Euler/Tait-Bryan angles, as it won't provide satisfying results with
> HMD devices or maybe devices with gyroscope.
> Thus, another patchset will come right after this one to refactor the usage of
> viewpoint in a more general way.
>
> Changes from v2 to v3:
> + use non-destructive `vlc_viewpoint_reverse` function
> + use `-value;` in reverse instead of `*= -1;`
> + indent for loops in `vlc_viewpoint_to_4x4`
> + reverse viewpoint when storing it in vout_helper, avoiding one copy
>
> I've indented the loops but I don't feel like it helps reading it, especially
> because the loops are interchangeable. Feel free to add/ask for braces.
>
> Changes from v1 to v2:
> + add documentation
> + move vlc_viewpoint_to_4x4 to a dedicated source file
> + use single precision computation in vlc_viewpoint_to_4x4
> + remove almost unused local RAD macro
> + refactor d3d11 output too
>
>
> Alexandre Janniaux (8):
>    viewpoint: add reverse viewpoint function
>    viewpoint: add euler to 4x4 matrix conversion
>    vlccore: export vlc_viewpoint_to_4x4
>    opengl: use vlc_viewpoint_to_4x4 to compute view matrix
>    opengl: use ViewMatrix instead of individual rotation
>    d3d11: rename View matrix into Zoom
>    d3d11: use vlc_viewpoint_to_4x4 to generate view matrix
>    d3d11: use View matrix instead of individual rotation
>
>   include/vlc_viewpoint.h                    |  33 ++++++
>   modules/video_output/opengl/vout_helper.c  | 112 ++++-----------------
>   modules/video_output/win32/d3d11_shaders.c |   8 +-
>   modules/video_output/win32/d3d11_shaders.h |   4 +-
>   modules/video_output/win32/direct3d11.c    |  71 ++-----------
>   src/Makefile.am                            |   3 +-
>   src/libvlccore.sym                         |   1 +
>   src/misc/viewpoint.c                       |  71 +++++++++++++
>   8 files changed, 137 insertions(+), 166 deletions(-)
>   create mode 100644 src/misc/viewpoint.c
>
> -- 
> 2.21.0
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel



More information about the vlc-devel mailing list