View Full Version : UE3 - UT3 Lightmap + dynamic shadow
25th Aug 2009, 07:56 AM
Is it possible to have a mesh that uses a lightmap and which can also recieve dynamic shadows from nearby InterpActors? I have a windmill and I'm trying to get the blades to cast a shadow onto the tower of the windmill as they rotate. I've converted the tower of the windmill to an InterpActor / KActor along with the windmill blades, but this causes the Static channel to uncheck itself during a build.
Is it one or the other? Or can I have both?
25th Aug 2009, 08:12 AM
iirc you have to set the blades as interpactor (which will rotate) and the tower itself as static mesh. you then have to enable dynamic channel on the tower and enable dynamiclightenvironment (or however its called, its a section with only 1 checkbox) on the blades. hope that does it.
25th Aug 2009, 09:02 AM
Thanks, definately looking like this is on the right track.
Only problem is that the shadow cast now seems to be coming from the direction of the Skylight (which isn't in the dynamic channel) instead of my primary D/S light source, and the dynamic shadow is also being cast on other meshes that aren't in the dynamic channel (the ground, speedtrees, etc). The windmill blades actually seem to be completely ignoring the lightsource from my D/S light (they've turned black) even though they both share the dynamic channel.
I may have overlooked something. I'll have to take a closer look tomorrow, thanks for the help so far!
25th Aug 2009, 09:16 AM
Lightenv shadows will cast over everything.
In editor, dynamic stuff can turn black until you click them, at which point they'll 'wake up' again.
Your primary scene light needs to have bcastcompositeshadows = true (and prolly have the composite dynamic channel enabled if it doesnt already). This will also sort out your character lighting. Make sure the interpactor is also in the compositedynamic channel.
If needs be, just place a small tight spotlight pointing directly at the mesh's pivot point and control it's shadow with that, if it's starting to mess with your main scene too much.
If all else fails, you can also tweak the shadow a little bit by expanding the mesh's lightenvironment settings and fiddling with the shadow souce location vector, but mileage will vary depending on the mesh.
26th Aug 2009, 09:03 AM
Almost got it! :)
One problem though. The shadow also appears to be projecting onto the rear side of the mesh. Looks really wierd.
Also, if I can't control what meshes will recieve the shadow from the blades, do I just use ShadowDistance to control how far the shadow can actually get?
26th Aug 2009, 09:50 PM
you could use light volumes and set the light to only affect the tower. but it still shouldnt cast a shadow on the backside.
27th Aug 2009, 06:50 AM
That wont affect the shadow and what it casts on at all. Using the same lighting type as is used for characters and guns, the mesh is casting self-shadow on itself, the only way to stop it doing that is to stop it casting shadows at all.
Another totally different solution would be to fake the shadow with a lightfunction, and make the meshes you dont want it to appear on not accept dynamic lights. But then ofc, they wont receive lighting from explosion effects etc ingame. Your call :)
27th Aug 2009, 09:34 AM
Damn, UEd wont go down without a fight will it? :rolleyes:
Here's a pic. Kinda looks like the shadows are just projecting through everything and making no distinction between front and back faces.
27th Aug 2009, 11:22 AM
Yep, no way around that, dynamic shadowing sucks. In Planetstorm you can see characters running around on the floor above you, the shadows of gunships projecting through roofs etc. We don't want to make every wall and floor 6ft thick, so meh.
Lightfunction then, but it's gonna be a big radius dynamic light so not that cheap.
Or rotate the windmill so the blades are casting onto the floor ^_^
26th Aug 2010, 10:20 AM
Wow, so one year later and here I am again - resurrecting dead threads and playing with my windmill :)
I guess I'm just wondering if anyone has found any cool tricks for handling this sort of thing in UE3 since then. I like the way the environment component shadows look, but they project through absolutely everything, so that's not an option. If it were possible to ommit certain meshes from recieving the shadow, then I could break the windmill up and only cast onto the front of the windmill where I want the shadow (guessing that's not an option though).
So my only other solution is to use a light function? In which case I would have to remove parts of the mesh from the dynamic channel which I don't want affected by the shadow, and lose the lighting from gun shots and the like?
If anyone has any great ideas, I'd be most appreciative :)
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.