- Home /
Inverting all light on trigger (2D)?
Hi all, pretty simple question, is there a way to use a trigger to invert all light sources (ie light areas becoming dark and dark areas becoming light)?
Thanks,
I can't tell what you're asking for.
You can disable or enable lights, but "turning dark to light" requires a light, just like turning light to dark requires the absence of a light.
Or do you want to invert your final image, like this?
Thanks for the swift response :)
Apologies, I hope this helps illustrate what I'm trying to accomplish: Imagine a black phone screen (darkness) with two light-bulbs emitting small areas of light around them (illu$$anonymous$$ated). I'd like to add a trigger that inverts this, so that the whole screen becomes white (illu$$anonymous$$ated) and the areas around the bulbs are black (darkness). NB: This example is an extremely simplified version of what I'd like to accomplish.
Depending on how you expect this effect to interact with other aspects of your visual experience, you either want an image effect which inverts your RGB values, or a hand-tailored solution to change elements of your environment by manipulating the color properties of their materials.
If you expect to use literal Unity lights, I do not know of any way to achieve what you're asking for except by inverting your render results with an image effect. There's no such thing as a Darkness Emitter in Unity; only lights.
I think there may be an easy way to get an Inverse image effect; I'm not familiar with Unity 5, but I recall having that effect in Unity 4 somehow or another. Try googling for it! :)
I'd like it to directly impact the environment, eg +10 score for every second you're in an illu$$anonymous$$ated area. Also static light-bulbs are a simplified example, ideally I'd like to apply the effect to moving entities - do you think I'd be able to accomplish this with the image effect you're referring to? If not, can you think of any alternative whatsoever? Cheers :)
Unfortunately, what I believe you're asking for is going to be quite tricky.
If you wanted to accrue points while illu$$anonymous$$ated, that can be tricky in and of itself. How you'll measure and respond to illu$$anonymous$$ation depends entirely on your project's nature, which I don't fully grasp.
Whether it's appropriate to use Unity's lights at all is still up in the air because I can't picture your desired end result. Introducing the concept of inverting light and dark areas with an image effect is not going to make things simpler.
Honestly this question has evolved into something you should post about in the forums. UnityAnswers isn't the place for such a complicated discussion. You may be more likely to get a response to such questions there.
Your answer
Follow this Question
Related Questions
How do I switch control values? 1 Answer
Using shadows as Triggers? 1 Answer
Light switch trigger 3 Answers
What am i doing wrong? I want to make a raycast acces panel with lights 2 Answers