Search Unity

How to send out all possible rays from the viewportpoint to the scene?

Discussion in 'Editor & General Support' started by econt, Jan 17, 2020.

  1. econt

    econt

    Joined:
    Apr 8, 2019
    Posts:
    52
  2. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    Can i ask why you wold like to do that?
    You should use raycast only if you really need them.
    For your case for HD resolution(1920X1080) you would have 2073600 raycast if you do it for every pixel.
    That would be extreme expensive.

    If you realy need to you can just nest two for loops and run the raycast for every pixel cordinate.