Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
0
Question by C_R_E_A_T_R_O_R · Feb 25, 2018 at 12:26 PM · lightingproceduralambient lightprocedural-terrain

How can i "simulate" ambient occlusion and precomputed GI on procedural mesh?

So i am creating a voxel terrain similar to minecraft. I create only the faces that are exposed to air and also the uvs for the textures and the normals with the commmand: mesh.RecalculateNormals().The problem is that the terrain is illuminated at the same amount whether its day, night or a specific area is not "seen" by the sun at all, like a cave. Here are some pictures to make things clear:

This is the terrain during the day: [1]: https://ibb.co/fdEhxc

This is the terrain during the night: [2]: https://ibb.co/bPL0iH

And this is inside a cave: [3]: https://ibb.co/dEkGOH

I know that i cant bake at runtime but shouldnt the default directional light simulate this darkening effect? What can i do? Do i have to write a custom shader or something? Thanks in advance!

Comment
Add comment · Show 4
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 Cherno · Feb 25, 2018 at 01:04 PM 0
Share

Experiment with multiple light sources from different directions. A good basic setup would be one normal one from diagonally above, like the sun, and one opposite which is far less intense and only serves to slightly lighten surfaces that are not lit be the sun. Also see if switching shadows for the light sources on and off makes a difference, as well as the ambient lighting amount.

avatar image C_R_E_A_T_R_O_R Cherno · Feb 27, 2018 at 04:43 PM 0
Share

@Cherno Thanks for the response! but im afraid i dont quite get you and you didnt quite get me.I have tried everything you said before except from the multiple lights. You mean multiple lights at the same time in the scene? I just use the default directional light. Also what i want is the more i descent in the terrain the less illu$$anonymous$$ated the area is but this is what i get ins$$anonymous$$d: [1]: https://ibb.co/kET7iH Some faces are lit as if they where exposed to the sun, which is not the case. I whould like to get smth like this: [1]: https://ibb.co/by$$anonymous$$SiH

avatar image Cherno C_R_E_A_T_R_O_R · Feb 27, 2018 at 06:16 PM 1
Share

You could use a shader that supports vertex colors and simulate lighting with it.

When using directional lighting, keep in $$anonymous$$d that surfaces that it can't reach because shadows = true and the surface is in a cave will only be affected by ambient lighting which leads to a flat, uniform look. That's why you should experiment with a non-shadow light. The same goes for surfaces that a light can't reach because it faces away from the light. This will also be only illu$$anonymous$$ated by ambient lighting, hence the need for a weak dir light ai$$anonymous$$g in the opposite direction.

For the "darker the deeper you go" issue, I don't know of any solution for this except a custom shader that takes y height into account or used vertex colors.

Show more comments

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

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

Layer based Ambient Lighting 1 Answer

SkinnedMeshRenderer modifying vertex colours? 1 Answer

Is it possible to fake Global Illumination within textures? 1 Answer

Scene is not pitch black when I set the Ambient Light Color to Black. 1 Answer

Turn off ONLY ambient lighting for just one object? 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