Search Unity

Question Button area, lens distortion, and panini projection

Discussion in 'Editor & General Support' started by Nijobe-Softworks, Nov 22, 2021.

  1. Nijobe-Softworks

    Nijobe-Softworks

    Joined:
    Nov 2, 2021
    Posts:
    9
    I am currently making a game and have several volume post processing effects including lens distortion and panini projection.

    The issue is that these post processing effects do not seem to effect where the "clickable area" for a button is as well. To me it seems like the volume post processing effects distorts the image, but nothing adjusts the clickable area of the button so they no longer line up.

    Has anyone had this issue and found a fix or am I just doing something incorrectly?
     
  2. Nijobe-Softworks

    Nijobe-Softworks

    Joined:
    Nov 2, 2021
    Posts:
    9
  3. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    If you distort the rendernd image in post processing your Physics / Click logic does not know anything about the change in the visuals and they will "Drift" apart.

    You would need to create a function to compensate for your image distortion for your mouse position.
    For the unity Event system it might be a bit more work.
     
  4. Nijobe-Softworks

    Nijobe-Softworks

    Joined:
    Nov 2, 2021
    Posts:
    9
    It seems like it is an oversight that built in functions dont take things like that into account.