- Home /
Is it possible to create a torus-/ring-shaped light? If so, how?
As the title says. I've been searching Google, but I can't get my head around it. Thanks in advance!
What is your goal? How large relative to the scene do you want the light? You can create a torus and give it an "emit" texture. This won't cast any new light but it will "appear" that the torus is a source of light. You can then place a point light in the center of the torus to actually cast a light. This will be a "close" notion.
I'm looking to create a ring of light inside a very dark scene that keeps expanding around the player, but also travels across any mesh it touches. Prototype 2's ping function is a good represenation of what I'm trying to achieve. I've been advised to use lighting, but if you have any other suggestions, please tell. Sorry for the unclear question.
Answer by Fattie · Jun 03, 2012 at 04:43 PM
It sounds like what you want is not "A LIGHT FITTING" (like "a chandelier")
What you want is like "SOME LIGHT FALLING ON STUFF"
In other words if I pointed a spotlight on a floor, that would be a "circle of light" on the floor -- what you want is a "donut of light"
Is that correct?
If so, I have your answer. You have to learn about "Projectors"
If you look at blob shadows, that is exactly what a projector is.
In your project, look around for the free standard assets that unity gives you.
Add a projector, blob shadow. In fact, ther eis indeed one that is a "shadow" (it's dark) and there is one that is a "light blob" .... which is exactly what you are asking for, I believe.
the only difference is you want a particular shape (a donut) rather than just a circle.
From here, you will have to do the work to figure out how to make it your own custom shape! I hope, that helps!
FTR earlier answer,
Just use a "self-illuminated shader"
http://unity3d.com/support/documentation/Components/Built-in%20Shader%20Guide.html http://unity3d.com/support/documentation/Components/shader-SelfIllumFamily
Nice catch, none of us understood what he was trying to do ^^
Actually, for light sources, there is already a Unity feature dedicated to this, called "Light Cookie". It's an alpha texture that's applied directly to the light source, so there's no need to fiddle around with Projectors: http://unity3d.com/support/documentation/Components/class-Light.html
Answer by Mortoc · Jun 03, 2012 at 01:29 PM
If you don't need the light to move in the scene, make a mesh torus, give it a light emitting material and bake it with the lightmapper. If you do need the light to change in the scene, give it a point light in the middle. An area based light is too complicated to run at runtime (at the very least without some complicated shader-fu)
$$anonymous$$y light is supposed to expand around the player, but also travel across any mesh it touches, much like Prototype 2's ping function. Would a similar approach work for this? Sorry for the unclear question.