UE3 - UT3 Lightmap + dynamic shadow

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Horror

New Member
Jan 27, 2008
86
0
0
39
Australia, Melbourne
www.vertexmason.com
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?
 
Last edited:

Bi()ha2arD

Toxic!
Jun 29, 2009
2,808
0
0
Germany
phobos.qml.net
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.
 

Horror

New Member
Jan 27, 2008
86
0
0
39
Australia, Melbourne
www.vertexmason.com
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!
 

Jetfire

New Member
Jul 25, 2005
354
0
0
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.
 

Horror

New Member
Jan 27, 2008
86
0
0
39
Australia, Melbourne
www.vertexmason.com
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?
 

Jetfire

New Member
Jul 25, 2005
354
0
0
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 :)
 

Horror

New Member
Jan 27, 2008
86
0
0
39
Australia, Melbourne
www.vertexmason.com
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.
 

Attachments

  • badshadows.jpg
    badshadows.jpg
    36.9 KB · Views: 27
Last edited:

Jetfire

New Member
Jul 25, 2005
354
0
0
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 ^_^
 

Horror

New Member
Jan 27, 2008
86
0
0
39
Australia, Melbourne
www.vertexmason.com
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 :)