Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 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 DerNibelung · Nov 08, 2017 at 11:54 PM · meshlightinggenerated

Blocky shadows on procedural terrain meshes

I have created a procedural terrain because the default terrain didn't fulfill my needs. Now I am struggling to get a decent lighting to work on it. I have one directional light, which ideally should be realtime. As you can see in the screenshot blow there are ugly stripes on this very simple mesh. They seem to move when the camera is moving. I've tried a range of things, including:

  • Camera clipping planes

  • Baking (seems to have the same result)

  • Light Probes

  • Rendering paths don't seem to have any effect

The higher I set the shadow resolution, the thinner these stripes get. - The vertices of the meshes have all normals up - The meshes have one UV channel

Can anyone help?

alt text

Comment
Add comment · Show 5
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 AidanHorton · Nov 09, 2017 at 11:16 AM 0
Share

Can't see a screenshot!

avatar image DerNibelung AidanHorton · Nov 09, 2017 at 12:15 PM 0
Share

If the screenshot above doesn't work, you can find it here: https://i.imgur.com/nWc6lo7.png

avatar image Zephire · Nov 09, 2017 at 12:25 PM 0
Share

Screenshots are showing fine here

avatar image Harinezumi · Nov 09, 2017 at 12:42 PM 0
Share

Have you set the normals of the vertices? Because looking at the screenshots it is really weird that one corner of a quad is dark while the other isn't... feels like normals issue (you can easily get the normal of the a vertex by using Vector3.Cross() of the neighbouring vertices' position).

avatar image DerNibelung Harinezumi · Nov 09, 2017 at 01:59 PM 0
Share

Yes, currently I've pointed all the normals straight up (in worldspace). I'll didn't try using Cross() yet. I've visualized the normals with Debug.DrawLine as you can see here: https://i.imgur.com/y3Tncr4.png

2 Replies

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

Answer by DerNibelung · Nov 16, 2017 at 12:18 PM

The comment of Harinezumi was very helpful.


Though, Instead of taking a cross product I now iterate every vertex normal and check its neighbours. Then I simply add them (then normalize them) to get the "average" normal of both. Along with incorrect lighting setting (my sun was under a very low angle) this has solved the problem and now I get decent shading on this low-poly procedural terrain.


The blocky shadows where artifacted because my directional light was under the exact same angle of the surface. That surface didn't have the correct normals, resulting in very weird shadows.

alt text

I went ahead and added a shader to texturize by vertex color ;-)

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

Answer by Daemonhahn · Nov 09, 2017 at 12:58 PM

This looks like problems with the bias settings on your light.

Go to the light / lights and adjust any setting with "bias" in its name.

Comment
Add comment · Show 1 · 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 DerNibelung · Nov 09, 2017 at 02:06 PM 1
Share

Increasing the bias shrinks the shadow, but doesn't seem to remedy the interpolating effect.

This screen has bias 0 and bias 0.5 respectively: https://i.imgur.com/to6gR7j.jpg

alt text

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

100 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 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 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 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 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 point light on generated mesh 1 Answer

Mesh does not have UVs suitable for Lightmapping - Lighting Issue 2 Answers

Light Overlap? What should I do to get rid of this weird effect on my mesh? 1 Answer

Unity URP black outline on my mesh polygons 0 Answers

Unity creates triangles and then lights them up wrong 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