Sign in to follow this  

Unity Unity light and shadows occlusion

Recommended Posts

paradisepx    103

Hello, i am creating a voxel game on Unity(free edition) but i have a problem on lights.

While going deeper and deeper in the caves, there is no shadows linked by direction light anymore but the blocks continue to be lighted.

How can i disable this to enable darkness in the deep.


Sorry for my english, i'm French.





Edited by paradisepx

Share this post

Link to post
Share on other sites
CowKing    154

If this has a Minecraft aesthetic, I wouldn't use a traditional light at all. Each cube would be "lit" by itself with the use of vertex colors. It would read the value of the fake light/lights(prefab of some sort with a LightScript component; probably only need omni light and directional light) and edit its own vertex colors based on the normal.


The beauty is that you only need to update when: the cubes are on screen, a cube next to it has been modified(added/removed). I assume you have a way of culling the cubes that are surrounded on all six sides.


Unless ofcourse you're going for an actual complex voxel system, in which case, I got nothing at the moment.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this