So who here has attempted to use vertex dynamic lights and lightmaps in unity? Ive tried and failed, unity seems to turn off the possibility of vertex based dynamic lighting when you lightmap your level. The only solution I found is to bake your level elsewhere rather than in unity but thats far from ideal. Has anyone found a way to make this work or created a shader that makes it possible? Im working on mobile games so this kind of tech would do wonders for me.
Replies
Im not sure I understand what you mean, heres a screenshot of what Im doing. Im trying to add vertex(not important) point lights eg explosion effects lights to an already lightmapped scene. As you can see in the screenshot the light is not effecting any of the nearby surfaces. I know it will look a little wierd if shadows get brightened but I dont mind too much as its just to make dynamic lights look more awesome.
Also if you want explosions to look a bit better, mess with halos and flares and what not. Usual lens flare texture probably won't work though.
Ive tried putting on culling masks, it shouldnt have been set to nothing in that screenshot, its usually on default. Sorry heres another screen to show what I mean, I want the light to still effect the lighting of the meshes even when set to "render mode: not important" as that is vertex lighting and ideal for mobile devices.
Somewhere in quality settings or render settings should be a light limit, of course this only applies if you're using forward rendering. Are you messing with shader models or anything as well?
"Yeah, the limitation Ethan talked about only affects VertexLit shaders. A vertex lit object, once lightmapped, does not receive any realtime lighting. We kind of chose this by design; using vertex lit almost always means "I want to run this as fast as possible" that's why we opted for no lighting once it's lightmapped.
Per-pixel lit shaders, once lightmapped, are affected by non-lightmapped lights. "
its on this page http://forum.unity3d.com/threads/104328-Vertexlit-gone-after-lightmapping
at the bottom of the page someone suggests an interesting vertex lit shader as a possible workaround.