Sign in to follow this  
GameObject

How to create shader that fades based on two different connecting surface angles

Recommended Posts

I'm working with Unity 5.x and trying create a shader that creates shadows at the edges of voxels similar to games like Trove and CubeWorld. You can see in this image below from my game (first image) that the shading between voxels is simply not there even with additional light sources. I believe that games like trove (second image) and cube world (third image) use a shader that creates a shadow between two voxels based on whether the two surfaces are meeting on converging right angles. Does anyone know how one would attain this effect in writing a unity shader? Right now I'm using the unity standard shader.
[attachment=29376:shadbetweenboxes.png]
 
Notice the shadow at the corner of two voxel surfaces, there is always a fading shadow at each voxel on two different planes.
[attachment=29377:shader2.png]
Here you can see two the same effect, there is a shadow at the edge of two different angles as the shadow fades.
[attachment=29378:shader3.png]

Share this post


Link to post
Share on other sites

Yes that's it, thanks. Unfortunately the Unity SSAO is almost useless so I'll have to find another solution or write my own Minecraft like AO.

 

Was reading through this, http://0fps.net/2013/07/03/ambient-occlusion-for-minecraft-like-worlds/, looks like it isn't too hard but within Unity sort of stuck on how to us a shader to go through the voxels or somehow join my chunkmeshcreator with the shader(?) blink.png

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