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 Becoming · Jun 09, 2013 at 04:42 PM · lightshadowsdistancelayersdirectional

shadow distance per light(Directional)?

Hi! We are working on a flight simulator and we want to have dynamically changing daytimes, so lightmaps are not an option(at least not an ideal one)...

The realtime directional shadows work nicely over the terrain up to 5000m as we dont need super detailed shadows in the distance but on the aeroplane the shadows look of course very bad with the shadow distance set this high.

Would it be possible in any way to have 2 directional lights with a shadow distance of 0-100m and a seperate directional light with a shadow distance set to 100-5000m?

I think with a setup like this it would be possible to have nice shadows on close objects and have low resolution shadows on far objects.

Thanks in advance for any tips, ideas , thoughts...

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
2

Answer by Becoming · Jun 11, 2013 at 01:23 PM

Some light on this Problem...

...

Ok, after some further research and testing i assume that the shadow distance is also limited to the camera far clipping plane not only to the shadow distance.

To be exact: The shadow distance is calculated from the position of the cam(not the near clipping plane) to the set shadow distance OR(!) the far clipping plane of the camera, depending on which value is higher.


To illustrate what that means for a multicamera solution, i used the following setup:

  • A directional light with realtime shadows turned on

  • Shadow distance set to 5000(set in the Quality Settings)

  • NearRangeCamera - near clipping plane: 0,1 / far clipping plane: 100

  • MidRangeCamera - near clipping plane: 100 / far clipping plane: 10000

  • FarRangeCamera - near clipping plane: 10000 / far clipping plane: 100000

(all values are just for demonstrating the issue, i would be very happy with a shadow distance around 2500 as well)


That means that the NearRangeCamera gets shadows on its full view frustrum. The MidRangeCamera gets shadows up to 5000 units from the camera position(the near clip plane gets ignored by the shadow distance). The FarRangeCamera gets no shadows at all because its near clipping plane is higher than the set shadow distance.

This knowledge will help you a lot if you're working on a flightsim or something else with huge viewing distances and long range realtime shadows.

But, does it solve my problem? NO! Unfortunately not!

Why? Well, there is a fade out on the shadow distance that i dont know if it's possible to disable... this leads to a interuption of the shadow from one cam to the other that moves with the motion of the cameras:

NearRangeCamera -> Shadowed Area -> Shadow fades out at the end of the view frustrum. -> (MidRangeCamera)Shadowed Area -> Shadow fades out at the set shadow distance. -> FarRangeCamera (does not matter for this as its beyond the shadow distance.)

Is there a solution? I dont know yet, maybe a shadow expert at unity can take a look at this problem. It would be highly apreciated!!!


I really want to know if there is a solution. I was playing with the thought to drop our dynamic daytime feature and use lightmaps but that just threw up another problem: The issues with beast and terrains: Beast takes forever to export a terrain and then uses incredibly amounts of ram, 32GB on my system were not sufficient for the 2049² Hightmap Terrain... This seems to be a known problem but i haven't heard that there is a solution or progress on it. It was never a problem with unity 3.5... But all that is a different topic!


Please dear moderator, show this post to someone who knows the shadow system well!! Aras Pranckevičius maybe?

Thanks in advance!!

Regards,

Peter at Team Becoming

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 Indiefreaks · Dec 06, 2013 at 01:11 AM 0
Share

This is a very interesting issue that I'll have to solve myself too with a game I'm working on which includes multiple camera views with similar distance differences.

Your point here is pretty interesting and surely the way to look forward.

I'll see if I come up with something when I'll get to this issue and let you know of my findings.

avatar image Becoming · Dec 13, 2013 at 11:30 PM 0
Share

Hey, that'd be awesome! $$anonymous$$, the prgrammer of the fabolous Relief Terrain Pack, made a quick hack for us, so we got a better transition but there is still a little gap in the shadows visible, so if you can find a way to do this, i would appreciate it a lot!!!

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

17 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

Related Questions

strange textures with directional light[solved] 1 Answer

Directional Light Shadows With Cookies 1 Answer

Directional light soft shadows softness doesn't work 0 Answers

Directional Lights STILL affecting shadowed objects! 1 Answer

Projector based selfshadowing? (Or other solution?) 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