- Home /
Bright, flat-rendered textures with NO lighting (no shading) - in C# code
Hello!
I am developing a scene that has several quads with textures (images) on them. Everything is being generated entirely in C#.
I need the textures to be completely flat-shaded - with no lighting. I removed the light source from the scene, which made everything dark (not surprising :) But my question is: how can I make the textures clear and bright (as if there were overall, non-directional ambient lighting in the scene)? I suppose I could add a universal ambient white light source and turn off shadows, but isn't there be a simpler way if I just need flat textures that appear similar to their original colors?
Thanks!
That's a non-answer. $$anonymous$$y question was about how to do this in Unity as opposed to talking about it like a philosopher. I think this is a Unity-related web site if I'm not mistaken.
Of course it's a non-answer, that's why I posted it as a comment, not as an answer. The question was meant in earnest. I wanted to know why you regard the ambient light method as so relatively complicated that you search for other solutions. If it becomes apparent that you implement this feature in a way that is more complicated than neccessary, maybe we can help with that. So as you can hopefuly see, I was trying to help and had put more thought to it, I didn't want to be a wiseass.
Happy coding!
Answer by tanoshimi · Jun 22, 2016 at 07:27 PM
Assign the Unlit/Texture material to your quads.
I am looking into deleting my account on Unity Answers. Too many answers are lazy and unclear. I don't get a sense of $$anonymous$$cher's pride among the people spitting out their quick pseudo-answers. I spent extra time and attention trying to craft my question to be precise.
Either don't answer the question (please), or spend the time to respond in-kind. I am a big fan of code examples, because - at the very least - I can try the code snippets, and let the compiler help me get it right. However: vague, haiku poem-like answers are generally not useful in a program$$anonymous$$g environment...unless you and I already share the same knowledge-base and vocabulary. And I'm sure we don't. There are many assumptions in each word in your haiku poem. I love poetry, but we are dealing with a precise technical environment.
We could all make this knowledge-ecology better, simpler and clearer if we each put in a bit more effort, to strive for excellence.
I came across this page:
http://answers.unity3d.com/questions/432710/meta-unity-answers-is-degrading-.html
It gave me validation for why I am thinking of deleting my account. -j
I'm not sure how my answer is considered lazy, when it contained everything you need to know. You could also have found that by reading this manual page: https://docs.unity3d.com/$$anonymous$$anual/$$anonymous$$aterials.html
Seeing as you seem unwilling to research how to apply what I described, I'll just tell you:
GetComponent<Renderer>.material.shader = Shader.Find("Unlit/Texture");
I can't show you where to put it since you've included no code in your question. Perhaps reading https://docs.unity3d.com/ScriptReference/Shader.Find.html would help.
This answer is hardly degrading although it does make some assumptions about the knowledge of the reader. If you check the FAQ (to the right), I think you'll see that those assumptions are more in line with the intent of this medium than they are in conflict with it.
JeffreyVentrella, the value of this forum is the answers, so let's be nice to those that take the time to answer our questions even if you need more information to be able to heed their advice. Simply asking for more details in a comment is more effective than a rant about answer quality directed at someone trying to help you.