• 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 SmilingCatEntertainment · Mar 07, 2015 at 02:51 PM · terrainshadows

Terrain Shadow Issue in Project Upgraded to 5.0

I'm upgrading my project to Unity 5.0, and I'm now having issues with my terrain as a shadow receiver. Everything was working fine in 4.6.

alt text

The test scene is just a simple cube half occluded by a brand new terrain, with another cube in hanging in midair. As you can see, it's as if the terrain mesh is not being considered in shadowing. No shadows project onto the terrain, and instead project onto geometry occluded by the terrain, though the shadows on that occluded geometry are being drawn on top of the terrain. I'm using the "Built In Standard" terrain material.

I managed to reproduce this behavior in a minimal scene using a brand new Terrain asset in my current project, but when I exported the scene to a new project, everything was fine. This was leading me to believe it is an issue with a project-level setting, though I could not find any significant differences in settings between projects.

So, seeing how using a brand new project seemed to correct the issue, I went for a Hail Mary and exported ALL assets from my current project, then imported them into a blank project (that was painful >.<). When I opened my minimal test scene, the shadows were still behaving incorrectly in this new project.

The shadows also work correctly if I change from the "Built In Standard" material to a custom material, but then I obviously lose all of the terrain multitexturing goodness. "Built In Legacy Specular" has the same shadow problem, and "Built In Legacy Diffuse" does not seem to work and draws a magenta mess.

The behavior in a built Windows .exe is different. When I build and run, the terrain acts like it is 100% in shadow all of the time. Very strange.

I'm out of ideas at the moment. I'll go with the "Built-In Legacy Diffuse" for now, but it would be nice to have this working using the new Material Based Shading goodness.

Anyone have any idea what could be going on? For reference, here is what my test scene should look like:

alt text

terrainshadowborkityness.png (364.5 kB)
terrainshadowref.png (365.0 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

1 Reply

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

Answer by SmilingCatEntertainment · Mar 07, 2015 at 03:35 PM

It turns out the problem was that I was overriding the default terrain shaders as part of a solution to allow holes in terrain. Once the overriding shaders were removed and Unity restarted, everything started working as it should.

Now I just need a new solution for holes in terrain :(

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 K.GPC · Jul 15, 2015 at 10:40 AM 0
Share

Thanks for providing the answer. I am having the exact same problem. Could you tell if the problematic shaders were part of a downloaded Asset Store package? If so, it's likely we're using the same package and could be useful to identify it.

avatar image SmilingCatEntertainment · Jul 16, 2015 at 01:34 PM 0
Share

In my case, they were created by me based in some info I found in the wild.

If you are not sure where it's co$$anonymous$$g from, you should be able to find it by doing a text search through all *.shader files in your Assets folder for the following strings:

"Nature/Terrain/Diffuse" "Hidden/TerrainEngine/Splatmap/Lightmap-AddPass"

For instance (win command prompt): Findstr -L -S -I "Nature/Terrain/Diffuse" *.shader

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

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

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

(FIXED) How to remove Unity 5 shadow artifacts? 2 Answers

Does the built-in Terrain Tree Billboard cast shadows? 0 Answers

Shadows are not continuous and only when i go near they be shown. 0 Answers

GLSL: Shader cannot be patched for instancing 1 Answer

Terrain flickering due to real-time shadows? 8 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