x


Can I cast real time shadows on lightmapped objects?

I've been working in a test scene and I just can't seem to figure out why it doesn't work while it's probably quite obvious. I've already spent many hours looking for the answer but I simply can't find it, so here it goes:

I'm using Beast to bake shadows on several objects in my scene which I have marked as static. An image of the scene can be viewed below. I've baked both point lights on the cubes and the plane by using 'bake selected' and excluded the blue ball by not selecting it. Everything seems to work just fine, but after the scene is baked I can't seem to project any real time calculated shadows on the lightmapped objects anymore. The blue ball can cast a shadow on any new object I bring into the scene, but not one of the lightmapped ones.

Is it possible for the plane and cubes to receive additional shadows of none-lightmapped objects such as the blue ball? If so, how would I achieve this?

![alt text][1] [1]: /storage/temp/1983-lightbaking_testscene.jpg

Thank you for your time.

more ▼

asked Jul 18 '12 at 08:02 PM

TiMMaH gravatar image

TiMMaH
16 1 1 2

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Is the ball set to cast shadows?

What shaders are you using and what is your render path? I'm not sure if you can have shadows with Lightmapped geometry that's vertex lit for example - you can't even have real-time lights working without writing some funky shaders.

Are you running Unity Pro? I believe real-time shadows are a Pro feature:

http://docs.unity3d.com/Documentation/Manual/Shadows.html

more ▼

answered Jul 18 '12 at 08:38 PM

Bovine gravatar image

Bovine
1.6k 26 30 47

Thanks for taking your time to help me.

I'm running Unity Pro, and the ball is set to cast shadows. In fact, it casts shadows just fine. It just doesn't cast shadows on the objects that are lightmapped.

My render path is deferred lighting and I'm using default diffuse shaders.

Jul 18 '12 at 09:45 PM TiMMaH

NP, What are your quality settings set to? Your shadow distance/settings?

Does the help throw anything up?

http://docs.unity3d.com/Documentation/Manual/LightmappingInDepth.html

Is the ball shadow being baked into the lightmap and then ignored - what is the Lightmapped setting on your light? Is your ball static?

Jul 18 '12 at 09:49 PM Bovine

My quality settings are on fantastic. My shadow settings are as follows: Shadows: Hard and Soft Shadows Shadow Resolution: Very High Resolution Shadow Projection: Stable Fit Shadow Cascades: Four Cascades Shadow Distance: 100

The shadow distance should be well within range and throwing it up doesn't make a difference. There's also a shadow distance setting in the lightmap display. When I play with this using dual lightmaps I can get the sphere to cast a faint shadow, but I'm not really looking for shadow blending because it's a game with top down perspective.

I'm not trying to bake the shadow of the ball at all. It's not a static object because it represents the moving objects in my scene. I'm using the auto lightmap setting on my lights.

Jul 19 '12 at 08:20 AM TiMMaH

I just figured out that I can duplicate the lights I'm baking,and set the duplicates on RealtimeOnly, the lights I'm using to bake on BakedOnly. This way I actually can cast a real-time shadow of the blue ball on the baked objects. It's a bit of a workaround though, because the scene gets a bit too bright or the shadows a bit too faint because I'm now using two lightsources, but it's something!

Any idea if I can use the same light for the baking and the real-time shadows? I can imagine this gives a better result. Right now it looks like this: http://i48.tinypic.com/2vrwhea.jpg But I'd like to have some more distinct shadows (shadow strength is already set to 1).

Jul 19 '12 at 08:28 AM TiMMaH

Could it be the issue described in the 3.5.2 release notes?

http://unity3d.com/unity/whats-new/unity-3.5.2

See the issue mentioned at the bottom.

Jul 19 '12 at 09:04 AM Bovine
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x327
x276
x230
x169
x35

asked: Jul 18 '12 at 08:02 PM

Seen: 1048 times

Last Updated: Jul 19 '12 at 02:42 PM