• 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
0
Question by DennisZ · Sep 20, 2014 at 09:17 PM · shadowslightmaplightmappinglights

Mixing baked and real-time shadows and real-time performance

Hello everyone.

I have a two-part question about lightmapping and dynamic shadows which I haven't been able to find a good answer to.

Question 1: How would you mix baked and real-time shadows if you want them to be cast by the same light source? I've tried using the same light source for first baking the lightmap and then setting it to real-time for it to render dynamic shadows of moving objects. This just causes the same light source to be cast a second time on top of the lightmap making it even brighter than it was before. Am I doing something wrong?

Question 2: What is the most performance hungry part of real-time lighting with shadows? Is a small scene with a lot of small shadow-casting objects more demanding than a large scene with a small number of large shadow-casting objects if there is only 1 light source?

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

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by MakeCodeNow · Sep 21, 2014 at 03:43 AM

1) The whole idea behind dual lightmaps is to support this kind of workflow. Near the camera the dual lightmaps only store bounce lighting and the local lighting + shadows comes from the dynamic light. Far away, the dynamic shadows are disabled and the lightmaps switch to baked versions. Is there a reason dual lightmaps don't work for you?

2) The specifics vary depending on a lot of specifics, but usually the main cost is the draw calls for all of the shadow casting objects. You basically have to have one draw call per shadow casting object per light source that casts shadows from that object. Directional light shadows use cascaded shadows which basically act like a unique shadow casting light source per shadow slice. Basically, the former is probably more CPU intensive while the latter is maybe more GPU intensive, but on most platforms CPU time is harder to come by than GPU time.

Comment
Add comment · 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

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How do I get objects to cast shadows on each other using BEAST? 1 Answer

Shadows not being baked on static objects 0 Answers

Directional light shadows when lightmapping 0 Answers

Real time shadows in a lightmapped scene (Android) 2 Answers

How much data is it too much in lightmapping for Mobile? 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges