Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
1
Question by JoeW97 · Nov 03, 2013 at 01:32 PM · lightmapshadow

Why is shadow strength always full black (1.0) in lightmap?

Hi

Why is it that shadows are always baked as full strength, even though I set the shadow strength on my light to, say, 0.5?

I've tried many permutations of settings and new projects, but always the same result.

The realtime shadow displays correctly, but of course it means they become darker as I leave the shadow-distance area.

This was asked before, but didn't get an answer:

Shadow-strength-doesnt-matter-in-beast-lightmapping

If this is simply how Beast works, is there another way to get paler shadows?

Thanks

Steve

Comment
Add comment · Show 1
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 JoeW97 · Nov 03, 2013 at 01:58 PM 0
Share

Just to clarify... using Dual Lightmaps with deferred rendering.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by psantoki · Nov 21, 2013 at 08:57 PM

Beast ignores several Unity settings, including shadow strength and even whether or not an object is marked as a shadow caster. In my game we had to physically disable alpha objects before doing a bake to prevent them from polluting the lightmaps. I chalk this up to sloppy Beast integration in the Unity code.

Onto your shadow strength. In a way, one can understand why shadow strength doesn't make sense to a ray tracer: it's job is to collect light, there's no such thing as shadow strength. To get the look of 50% shadow strength in a ray tracer one would have to make shadow casters 50% translucent or add an ambient light to the scene to bring the overall lighting up.

There is no ambient light in Unity*, however (**actually there is! see below*)

  • Sky Light. There is a Sky Light in the Lightmapping Bake settings. You need at least one bounce to enable this feature. Sky light isn't exactly an ambient light but for outdoor scenes this can bring your lightmap brightness up.

  • Bounces. Sufficient bounces fills in shadows by virtue of light scattering. Another way to flood more light into the darks of the lightmaps, but again not the same as ambient light.

  • Just add ambient light in your shader. In your game shaders instead of tapping the lightmap and using those values directly you can add light to fake shadow strength. You can lerp or do a saturate(lmValue + a) in which a is (1 - shadow strength). This is the most visually correct way to match your dynamic light shadow strength, but it costs instructions in the pixel shader so it's less elegant.

In my game we used pairs of weather settings for in-game and lightmap baking (sunset dynamic, sunset lightmap) specifically so we could tune lighting in lightmap bakes to match the dynamic lighting of the game. There are several reasons besides shadow strength to do this, such as Beast making lightmaps that are brighter than the light source itself which mucks up dynamic highlights.

Comment
Add comment · Show 2 · 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 psantoki · Nov 21, 2013 at 09:21 PM 0
Share

Ah! There IS an ambient light setting in Unity!

It's under Edit > Render Settings > Ambient Light. Before doing a lightmap bake, just set this to 50% grey (100% - shadow strength)

Remember to unset this before running the game, it affects the dynamic lighting too, thus everything in your shadow-distance area will be extra bright. Another reason to have bake/dynamic weather pairs.

avatar image JoeW97 · Nov 22, 2013 at 04:38 AM 0
Share

Thanks, interesting read. Although I had already tinkered with ambient light settings, it does flatten things a lot. But the idea of tweaking pre- and then post- baking hadn't occurred to me :) I agree that shadow strength wouldn't be part of a physically accurate algorithm, but as practical 'cheat' to get the final look right, I'm surprised it isn't there as an option as it is in some renderers; after all, the shadow areas are mapped in the normal lighting algorithm, it would be as easy post-bake adjustment to lighten those areas a little.

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

16 People are following this question.

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

Related Questions

Can transparent textures be lightmapped? 2 Answers

Realtime shadows on lightmapped surfaces 3 Answers

LightMap: No Shaows on ground? 1 Answer

Lightmapped object in Surface-shader 0 Answers

Shadow is cast through multiple objects 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