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. Dismiss Notice

Question Advice on 2D overlay please..

Discussion in 'Editor & General Support' started by tclancey, Oct 5, 2020.

  1. tclancey

    tclancey

    Joined:
    May 19, 2017
    Posts:
    143
    Hi folks.

    I need to give my player a radar overlay on a 3d game. I'm currently using a culling camera with everty gameobject having a child 'radarobject' on another layer, so my radar camera only renders the object's 'ping' object, very simple geographic shapes. This (while not fully working yet) is ok, but I don't have the control over all the pings I want.

    As all the objects are basically 3d objects I can't control a brightness or colour on them separately as you would get with a radar sweep. I can them a shader, but doesn't changing the value on one shader affect all instances of the same shader? Is there a way around this?

    Alternatively, is there any way to apply a totally 2d overlay? Can I manually draw defaultParticle graphics to a texture and splash it on a canvas? Or even just splash it to a 3d object in the scene. Would I gain anything in control over colours?

    I haven't done any 2d stuff yet, so my knowledge in that area is really lacking. Yes, I could go and study all the manual info and spend a week writing a load of test stuff, or I can ask here and hopefully someone could help me avoid the pitfalls I'll inevitably fall into.

    I hope you understand what I'm getting at.
    Thanks.
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,722
    Use a material with an unlit shader for the "ping" objects. A material is a shader + parameters for the shader, so no you don't need the same settings for every instance of the shader in your game, you manage different settings with materials.

    Alternatively, use a SpriteRenderer instead of a MeshFilter + MeshRenderer.

    if these are objects that are attached to 3D objects it doesn't really make sense to try to use UI/Canvas elements here. You can use Quads with textures or just objects with SpriteRenderers to draw 2D stuff in 3D space.
     
  3. tclancey

    tclancey

    Joined:
    May 19, 2017
    Posts:
    143
    The quads with a simple texture is what I need, I'm thinking old radar screen with blips, not representations of the objects. Well, maybe, but not detailed.

    So where do you get started drawing 2d sprites in a 3d project? (Goes off hunting........)