Hello, Is it possible to make tube shape(Floresant Lamp) light source in Unity3D. Thank you.
If you're using lightmapping: Yes, just set up your tube mesh and use an emissive (self-illuminating) shader on it. Set the Emission (Lightmapper) property of the material to something greater than 0. (Note that this might only work in Unity Pro - I don't know how much is available in Unity Indie).
For dynamic stuff: Not really. It's common to just place one or more point lights next to your tube. You could also try using a spotlight with a cookie texture, to 'box' the light to the right outgoing shape.
You can use multiple point lights to simulate this, reducing the intensity of each one proportional to the total number. For example, if you use 5 lights in a row to simulate a single light where the intensity should be 1.0, then have the intensity of each individual light be 0.2. This is, of course, more resource-intensive than using a single light. Using deferred rendering may mitigate this to some extent, since the cost depends on the number of pixels lit rather than the total number of lights. You should also make sure you set the quality settings to use an appropriately high number of pixel lights.
It’s 2021, but I haven’t found any/many posts about “tube lighting” in Unity, so I will post here. I will keep looking, but I haven’t found anything yet about making a long light source in Unity (2018-2019), such as you would see along a laser beam as it passes objects. I have read posts of others attempting such an effect and they mention “spotty” lighting because they have to use a series of poit lights instead of a beam. Does anyone have any advice, insight or suggestions? I prefer Unity 2019 LTS and below version answers, thanks in advance.
In HDRP, there is a lighting mode called Tube
which can be found under Shape
in the Area
-type Light
component.
© 2022 - 2024 — McMap. All rights reserved.
Another way could be to use a orthographic projector to project a light-texture but that's not the same as a "real" light. http://unity3d.com/support/documentation/ScriptReference/Projector.html
– AndvariHere you go: http://www.richardfine.co.uk/junk/lightmapping-demo.html
– DiaconiconAlso, if you tried the emission settings in Unity Pro, make sure that you've set up and baked the lightmaps! You won't see any visible changes until you've done that. More info in the manual here: http://unity3d.com/support/documentation/Manual/Lightmapping.html
– DiaconiconLook at the 'cookie' on the spotlight in my project. Turn up the light intensity to see it more clearly.
– DiaconiconWhy don't you think it would work? The idea behind the cookie is just that you can use it to 'shape' the dynamic light to try and match the lightmap. You can make any shape you like, put an emissive material on it, bake the lightmaps; then place one or more lights, using cookies to try and get the dynamic lighting environment to be as similar as possible to the lightmap. It'll never work perfectly, but you can get something that at least does not look wrong.
– Diaconicon