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 Why does LineRenderer appear as a different color?

Discussion in 'Editor & General Support' started by Razputin, Jun 30, 2023.

  1. Razputin

    Razputin

    Joined:
    Mar 31, 2013
    Posts:
    347
    The red on the walls and the red on the linerenderer are using the exact same material, so why does the linerenderer come out darker? Anyway to brighten the LineRenderer up?

    upload_2023-6-30_16-49-37.png
     
  2. KillDashNine

    KillDashNine

    Joined:
    Apr 19, 2020
    Posts:
    449
    Here's a box and a line rendered with standard shader and just whatever image, look same to me. upload_2023-6-30_22-16-42.png

    If your material is using some image that has some darker areas, then obviously it is a matter of how this image is laid out on your object, if those darker areas would happen to be visible from the angle youre viewing from.

    Also, my image uses standard shader. I'd say your issue comes from your shader, is it an additve transparency shader that adds to whatever is shown from behind it?
     
  3. Razputin

    Razputin

    Joined:
    Mar 31, 2013
    Posts:
    347
    I'm using a default material that has it's color set to red with no changes to any other settings.

    Changing it to a sprite shader seems to make it the right color... hmm... I guess maybe it's lighting? But I have receive shadows turned off on the LineRenderer.
     
  4. KillDashNine

    KillDashNine

    Joined:
    Apr 19, 2020
    Posts:
    449
    Dno what material you are using, as default material color cannot be changed.
     
  5. Razputin

    Razputin

    Joined:
    Mar 31, 2013
    Posts:
    347
    Default as in, a new unedited material. Not the actual Default-Material, my bad.

    upload_2023-6-30_17-29-21.png
     
  6. KillDashNine

    KillDashNine

    Joined:
    Apr 19, 2020
    Posts:
    449
    So, Standard shader in opaque mode :) Anyways, I'm quite sure the issue is not in some difference between LineRenderer and MeshRenderer but I would guess lighting of the scene, the shape of the objects or something of that nature. Can't help you with the exact answer.
     
  7. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    10,977
    Lighting. Also it matches fairly close the left wall that is darker.

    Make a different material for the linerenderer and adjust it to your liking.
     
  8. Razputin

    Razputin

    Joined:
    Mar 31, 2013
    Posts:
    347
    True, but it remains the same color if I take it out from under there.

    upload_2023-6-30_23-43-15.png
     
  9. Razputin

    Razputin

    Joined:
    Mar 31, 2013
    Posts:
    347
    Okay I turned on generate lighting data and it became the expected color. I guess this needs to be on for lit shaders, then you can turn receive shadows off.