Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

How would you do this?

Discussion in 'General Discussion' started by derkoi, Apr 11, 2018.

  1. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,238
    Hey all,

    I'm wanting to make an echo sounder in Unity for my fishing simulations.

    Just wondering how to go about it? I was thinking of drawing pixels but it seems really slow. I thought about UI segments but it seems a bit backwards.

    I already have the echo sounder script, i need to figure out the display.

    Here's a video of what I'm trying to do:



    Any ideas please?
     
  2. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,238
    Anyone?
     
  3. SnowInChina

    SnowInChina

    Joined:
    Oct 9, 2012
    Posts:
    204
    i am not sure i interpret the video right, but couldn't you take a camera, filter out any objects not needed, set a max distance and do a render to texture ? with some vfx you could get a look like that i guess ?
     
  4. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,238
    Hmm, not sure that would work to good. Wouldn't get all the details and probably wouldn't see the terrain from a side.
     
  5. SnowInChina

    SnowInChina

    Joined:
    Oct 9, 2012
    Posts:
    204
    you could get terrain in there if the camera is set to perspective and you limit the render distance so its would only sample a small strip
    maybe not the best solution, but it could work okay
    you could also build a special shader which would look like the sonar and use this on every model for the second camera
     
  6. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,433
    I think I would do it by making a camera render to a rendertexture and using a particlesystem to "draw" on it. If you don't require crazy high resolutions it shoul be more than fast enough. Depending on your usecase you can probably make it so that you only draw the column of new data on the right and shift everything to the left in an image-effect on the rendertexture camera and just not clear it between frames. I've done something very similar to "paint" craters and burned areas onto a global "damage texture" that is used by my custom terrain shader.
     
    derkoi likes this.