- Home /
LineRenderer renders the wrong color
I create a LineRenderer in Unity 2018.2.1f1. I set the material to builtin Default-Line; which has Particles/Alpha Blended Premultiply. I set no shadow casting and no light probes. The rendered color is lighter than the color I gave:
I have tried all the shaders in unity, but I couldn't get the exact color. Is there a shader that would render the correct color?
Answer by ybaklaci · Sep 13, 2018 at 10:11 AM
After doing some tests in different projects and platforms, it looks like the reason to wrong color rendering is the Linear Color Space. I chose Linear Color Space for better light rendering. But apparently even though there is no light in the scene, only Line Renderer's color is not accurate.
2 years later you saved my ass :) thanks for posting this update.
Answer by Atiyeh123 · Sep 12, 2018 at 05:53 PM
HI @josbe , you must set the material to Sprites-default. you've just set a wrong Shader.
Hi @Atiyeh123, Sprites-default was the material I started testing with. So, that doesn't work either.
Answer by m039 · Nov 26, 2020 at 03:23 PM
I fixed the issue by creating new shader which converts a vertex color to linear space. You can see the shader on the image. I used 2021.1.0a6 Unity that is why Shader Graph is different a bit.