Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
3
Question by TiMMaH · Jul 18, 2012 at 08:02 PM · shadowslightmapstaticdynamicbaking

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.

lightbaking_testscene.jpg (13.3 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by Edy · Aug 18, 2013 at 12:04 AM

I assume you've marked "Lightmap Static" on all objects but the sphere.

The behavior of the realtime shadows strongly vary depending on the Rendering Path.

In Deferred Lighting with Single Lightmap you only choice is to use Realtime-only lights, which also affect the lightmapped objects. Auto lights will cast realtime shadows from static (lightmapped) objects onto dynamic objects, but not the opposite. In your scene with Auto lights, the cubes cast realtime shadows on the sphere.

Alternate option: Forward Rendering + single Directional Light in Auto mode.
This light will cast realtime shadows from dynamic objects onto lightmapped objects. Note that in Forward Rendering the realtime shadows are limited to a single directional light. You can use other lights to bake the lightmap, but they won't cast any realtime shadows.

Full details here: http://www.edy.es/dev/docs/unity-3d-lightmapping-reference-guide/

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Cameron Petty · Aug 14, 2014 at 12:50 AM 0
Share

That is a very thorough and well illustrated guide, Edy. Nice work on that - answered this same question for me. Cheers.

avatar image
1

Answer by Bovine · Jul 18, 2012 at 08:38 PM

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

Comment
Add comment · Show 9 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image TiMMaH · Jul 18, 2012 at 09:45 PM 0
Share

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.

$$anonymous$$y render path is deferred lighting and I'm using default diffuse shaders.

avatar image Bovine · Jul 18, 2012 at 09:49 PM 0
Share

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

Does the help throw anything up?

http://docs.unity3d.com/Documentation/$$anonymous$$anual/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?

avatar image TiMMaH · Jul 19, 2012 at 08:20 AM 0
Share

$$anonymous$$y quality settings are on fantastic. $$anonymous$$y 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.

avatar image TiMMaH · Jul 19, 2012 at 08:28 AM 0
Share

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).

avatar image Bovine · Jul 19, 2012 at 09:04 AM 0
Share

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.

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

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

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Casting realtime shadows on lightmapped objects 1 Answer

Baking shadow maps for static objects spawned at runtime 0 Answers

How to get Real-Time Light on Static Lightmap? 1 Answer

Dynamic lights being baked into scene? 1 Answer

Shadowmask shadows not showing 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges