Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 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
2
Question by MisterMike · Feb 24, 2014 at 11:52 PM · shadowsshadowartifactsshadowmap

How to deal with shadow scale and self-shadows?

So, Unity and self-shadows on characters, no matter what combination of 'Clipping Plane' near/far distance, shadow distance and map resolution can I get it to render correctly.

My characters are measured in meters where 1 unity unit = 1 meter. This is the same as the internal physics uses and what we scale time against to get things to behave right in scripts. But for shadows this just turn out to be too small a scale it seems, standing 1.8 units high for 180cm this causes severe rolling 'banding artifacts' in the self-shadows as one move.

If I make my character really large, scale it to be 5x the size and stand 9 meters tall shadows can deal with it and can be dialed in to render correctly. So can I somehow make shadows behave this way but at unity's native scale of '1 unit = 1 meter' or am I really to be F'ed in the A by unity on this? I've attempted tweaking the code in the 'Shadow-ScreenBlur.shader' but replacing it as with the terrain shader doesn't seem to have any effect at all.

I have a file illustrating my problem but I can't upload it, keep getting 'Error parsing the uploaded file'.

Comment
Add comment · Show 2
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 · May 12, 2014 at 10:05 PM 0
Share

Hi $$anonymous$$ister$$anonymous$$ike, I'd like to help you

  1. A lot of professional games use a special shadow pass just for the self-shadowing of main characters. This way, for instance, you could get gloriously long sunset shadows while at the same time having the precise, self-shadowed nose of your protagonist. No need to impossibly tune for both ends of the spectrum.

  2. There's a lot of effort involved in that, with or without Unity. With Unity it's a touch harder since Unity likes to handle all shadowing for you, so you'll have to go behind its back to do this work (meaning: set up your own rendertarget, make a draw calls list and render out your shadow tile to be sampled later. Since we can't access Unity's shadow collector you'd have to calculate those shadows from the material shader of your main character directly)

  3. If that sounds roundabout, it's because there's a big gap between the concepts of a rendering pipeline and what Unity will physically allow you to do in its claustrophobic corridors.

  4. I have to get this out of the way: if there's any way to tune away this problem, go for that first. Are you using cascaded shadows? If not then turn it on, gives you more precision up close. Besides that apply the usual: crank up the resolution of your shadow maps, use Camera.depthTexture$$anonymous$$ode = Depth ins$$anonymous$$d of DepthNormals because you get greater precision (this has deeper effects however, are you using deferred rendering by the way?)

If you have time and passion, try #1. Otherwise, or if that doesn't work, just tune your best. I know that sounds like a cop-out. You're in Unity land now.

With Unity you must resign yourself to compromise. There are so many things one wants to do in Unity that just can't be done. I broke Hable's most famous law by shipping AO in sunlight. This is inexcusable; no way around it in Unity. Forgive yourself, and let me know if #1 works!

avatar image Renderluz · Apr 15, 2016 at 05:31 AM 0
Share

I have this same problem, what I found to be strange is that Unity has this system working against working on a real world scale, this mechanism would have been on my priorities when dealing with a game engine I would image, so it baffles me that it does not work, save if you have your world created 10 times bigger than it should be, which then carries other problems like having the camera moving sluggishly, I haven't found a solution for this issue either... so if someone has a solution I would be grateful.

0 Replies

· Add your reply
  • Sort: 

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

22 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 avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Disabling dynamic shadows in deferred rendering (Unity 5) 1 Answer

How to store directional light shadowmap? 1 Answer

Shadow Artifacts SketchUp dae to Blender FBX Model 0 Answers

Shadows being received by non-shadow collectors that are depth culled by a shadow collector. 1 Answer

How to prevent holes in shadows without generating Shadow Acne? 1 Answer


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