|
created Lightmapping + dynamic lights
on 02-07-2012 03:28 AM
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.
|
, veteran polycounter,
3,899 Posts,
Join Date Feb 2007,
Location UK cheltenham
|
I'm doing this, in Unity Pro. Lightmap is added automatically to all Unity shaders, so no need for something special. Just have to make sure the light Cullmode is setup properly, so it affects the lightmapped meshes. You might also want to set those lights to Realtime Only, so they don't get added to the bake.
|
, Polycount.com Editor,
6,663 Posts,
Join Date Oct 2004,
Location Boston USA
|
Quote:
Originally Posted by Eric Chadwick
I'm doing this, in Unity Pro. Lightmap is added automatically to all Unity shaders, so no need for something special. Just have to make sure the light Cullmode is setup properly, so it affects the lightmapped meshes. You might also want to set those lights to Realtime Only, so they don't get added to the bake.
|
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.
Last edited by Ged; 02-07-2012 at 07:38 AM..
|
, veteran polycounter,
3,899 Posts,
Join Date Feb 2007,
Location UK cheltenham
|
Culling mask. It's not lighting anything, because it's not set to light anything. Set it to something that is the layer of something nearby.
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.
|
, triangle,
349 Posts,
Join Date Dec 2010,
Location Brisbane
|
Quote:
Originally Posted by Brendan
Culling mask. It's not lighting anything, because it's not set to light anything. Set it to something that is the layer of something nearby.
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.
|
, veteran polycounter,
3,899 Posts,
Join Date Feb 2007,
Location UK cheltenham
|
Ah, I think you've maybe hit your limit of lights, and/or somehow vertex lighting and SH is just being ignored.
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?
|
, triangle,
349 Posts,
Join Date Dec 2010,
Location Brisbane
|
No sorry there arent any extra lights or settings wrong, I saw this on the unity forums:
"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/104...r-lightmapping
at the bottom of the page someone suggests an interesting vertex lit shader as a possible workaround.
|
, veteran polycounter,
3,899 Posts,
Join Date Feb 2007,
Location UK cheltenham
|
so basically, just to conclude this, it seems its just not possible to use vertex lit materials and vertex lights and lightmaps all at once in unity. Unless you have the know how to make some bespoke vertex lit lightmap shader that accepts vertex lighting?
|
, veteran polycounter,
3,899 Posts,
Join Date Feb 2007,
Location UK cheltenham
|
now this is crap, i have been having the same issue with the project im working on currently :<
|
, triangle,
371 Posts,
Join Date Jun 2011,
Location germany
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Copyright 1998-2012 A. Risch
|