x


Baked + Real-Time Shadows

I have an outdoor scene with a single directional light and am using forward rendering and using Unity Pro.

I was planning on using baked shadows for the terrain, tree, structures, etc and using real-time shadows for the characters.

What is the best way to achieve this?

more ▼

asked Jan 12 '11 at 11:44 PM

Kent J gravatar image

Kent J
13 4 4 8

Retagged with lightmap(ping) and singular shadow. Both pairs of tags are running about neck and neck in popularity.

Jan 13 '11 at 03:35 AM yoyo
(comments are locked)
10|3000 characters needed characters left

4 answers: sort voted first

Um, what's the politest way to say rtfm? :-)

Read these first, try some stuff -- if it all works, awesome, come back and answer your question so we can all benefit from your new-found knowledge ... if it doesn't, not to worry, come back with specific questions. Good luck!

http://unity3d.com/support/documentation/Manual/Lightmapping.html http://unity3d.com/support/documentation/Manual/Shadows.html http://unity3d.com/support/resources/tutorials/lightmapping-in-maya

more ▼

answered Jan 13 '11 at 03:32 AM

yoyo gravatar image

yoyo
6.5k 25 39 84

Um, what's the politest way to say you are a jerk? :-)

Feb 18 '11 at 05:37 AM Turbo

Well, that wasn't my intent, just wanted to point out the available resources. Sorry if it came across the wrong way.

Feb 18 '11 at 03:33 PM yoyo
(comments are locked)
10|3000 characters needed characters left

If you wanna use realtime shadows together with beast lightning you need light that lights aren't going to bake. So choose the light that you want to make the realtime shadows and make sure it is realtime only in lightmapping options. And make sure your object is not static and that the lights shadow type is either soft or hard and strength is enough to make shadows visible. There should be more information about this matter. http://docs.unity3d.com/Documentation/Manual/LightmappingInDepth.html

more ▼

answered Feb 28 at 01:37 PM

Emihaa gravatar image

Emihaa
16 2

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

The short answer is, as far I know, you can't. In my testing, as soon as you lightmap geometry using Beast, realtime shadows no longer work. I would love for someone to prove me wrong.

However, you can use dual lightmaps, which will smoothly blend between your lightmaps and your realtime shadows. This is nice, but often times your lightmapped shadows will look much better, or at the very least, different, from your realtime shadows.

more ▼

answered Feb 18 '11 at 05:45 AM

Turbo gravatar image

Turbo
1 2

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

"In my testing, as soon as you lightmap geometry using Beast, realtime shadows no longer work. I would love for someone to prove me wrong."

OMG, was going crazy with this one but think I've got the solution...I baked a lightmap on my terrain and then couldn't enable realtime shadows again after that--even if I disabled lightmapping. Saw your comment and tried the same with another object--yep, after baking a lightmap, I couldn't ever get a realtime shadow from that object again. UNTIL...

I selected my object that lost realtime shadows ability, went under Lightmapping > Object > Atlas, and changed the Lightmap Index to "255", matching the other objects I hadn't lightmapped...

It works! Real-time shadows are back.

Note you must have "Static" enabled for the object in question to make this change, but then you can un-check Static again afterwards.

more ▼

answered Feb 25 '12 at 03:05 AM

theropodx gravatar image

theropodx
1 2

(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:

x335
x221
x209
x178

asked: Jan 12 '11 at 11:44 PM

Seen: 5492 times

Last Updated: Feb 28 at 01:37 PM