- Home /
Turn off ONLY ambient lighting for just one object?
I'm trying to make an object only lit by one light. I don't want ambient light to affect it, but I want ambient light to affect other objects. I am using unity 2018.1.6f1. How do I do this?
Answer by JonPQ · Jul 22, 2019 at 05:48 PM
I might be mistaken, I think the ambient lighting is built-in to the lighting model for all standard unity shaders. So I think you'd need to make/modify a custom shader, with it's own lighting model, with ambient as shader parameters.
Another possible option...There are callbacks you can put on a script on an object.... OnPreRender, OnPostRender. So.... you could try changing the global ambient light settings via script in that OnPreRender, then changing them back in the OnPostRender. I'm not sure if this would have any performance considerations or not... you'd have to try it and see.
Agreed - a custom shader that doesn't use ambient lighting would be the way to go here.
Your answer
Follow this Question
Related Questions
Local Ambient Lighting 0 Answers
Unity5: Changing AmbientSkyColor doesn't change Skybox Color 2 Answers
Ambient Intensity not working 2 Answers