• 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 /
  • Help Room /
This question was closed Mar 02, 2016 at 07:54 PM by Le-Pampelmuse for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by multinfs · Mar 01, 2016 at 07:00 PM · lightingproceduralworld

[Solved] GI like lighting in procedural world

So I have this procedural world that is generated at runtime and I'm not pleased with how the lighting handles the resulting mesh..

[Solved] 1. First issue is that I would like to have Global Illumination in the world but since it's a procedural world the possibility for that is out the window. So I'm stuck with pitch dark shadows in places where no light shines, is there any solution to this?? (Note that raising the ambient light just makes the now black area a bit brighter, leaving out the details of the mesh)

Img1 EDIT: I fixed this by changing my shader a bit.

[Solved] 2. Second issue is the directional light used as a sun doesn't know where not to shine it's light, it doesn't get blocked by terrain above a cave but instead lights up the floor inside the cave. Why does it do this and is there any fix for it?? (Note2 I'm using my own shader for the terrain in forward rendering mode but I doubt that is the problem) I have tested with disabling backface culling in the shader but that doesn't help at all..

img2

temp2.png (212.1 kB)
temp1.png (491.4 kB)
Comment
Add comment · Show 12
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 Graphics_Dev · Mar 01, 2016 at 07:12 PM 0
Share

A directional light has a shadow strength property you can use to make shadows not pitch black.

Show more comments
avatar image Cherno · Mar 01, 2016 at 07:30 PM 0
Share

Are you using real-time shadows?

Copy your "sun" light source, give it an intensity of about 0.1 or 0.2, and don't let it cast shadows. This is your "back-up" sun which basically works as a form of ambient lighting that can slightly enlighten all the places that would be cast in shadow otherwise. The main advantage is that it will also pick up normal maps. You can go one step further and make another back up sun light, but let it shine in the inverse direction (diagonally upwards). With this setup, you will have all surfaces covered.

Show more comments
avatar image Polymo · Mar 02, 2016 at 01:16 AM 1
Share

You should be able to change the light-angle-falloff in a custom lighting function like the diffuse wrap example in the manual http://docs.unity3d.com/$$anonymous$$anual/SL-SurfaceShaderLightingExamples.html to get more details out of the dark areas. And for the sunlight inside the cave, enabling shadows is the way to go (what you described is the normal behaviour of virtual lights).

avatar image Nick Brooks · Mar 02, 2016 at 07:33 PM 0
Share

@multinfs Wow, how did you do the vertex welding for the terrain? Looks amazing.

Show more comments
avatar image Le-Pampelmuse · Mar 02, 2016 at 07:53 PM 2
Share

Don't "tag" questions with "Solved" or similar. Close them if they are answered so it it obvious. IF they are not closed, and someone comments, or edits some content on it, it will pop up on the feed of the front page, which is useless.

1 Reply

  • Sort: 
avatar image
0
Best Answer

Answer by multinfs · Mar 02, 2016 at 11:45 AM

Soo, to make the solution clear to my problems I simply had to modify my shader a bit to 1. Handle ambient lighting correctly ( The ambient wasn't adding the color of the fragment but the ambient color only.) 2. Support shadows ( Added built in AutoLight.cginc functions to shader for shadows )

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

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

42 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

Related Questions

How to get objects to spawn in according to rules 1 Answer

I'm having these pitch black areas in the game. Does anyone know what is causing this? 1 Answer

Can I have an Invisible Mesh which renders lighting and shadows as if it were not invisible? 0 Answers

How to render a particle in front of parent? 1 Answer

How can I make my lighting from HTML5 match my .exe? 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