Page 1 of 1

Texture as shadows

PostPosted: Fri Apr 20, 2018 7:40 pm
by Freitas
Hi guys,

I would first like to thank you for creating this amazing tool, its so much better then the UE material editor.

So, I'm trying to create the shadow effect from the image below, the edge of the shadow have some kind of texture.

Image


With the shader below I can change the texture shadow, but works only with flat colors.
Image

In one of my attempts, I was able to add another color to the "shadow border/edge" but I forgot to save the graph :roll: but was made only using lerps + blends...

I also found this graph from Shader Forge:
Image
And the shader:
Image

I tried to remake the shader above (Shader Forge), like this:
Image

But I got only this on the Unity view, no texture, only white color :(
Image

I also tried to use the Light Attenuation as a mask :lol: and no success

Do u guys have any suggestion on how or if its possible to make this shader or someting close to this using Amplify?

Re: Texture as shadows

PostPosted: Mon Apr 23, 2018 11:37 am
by Amplify_Borba
Hello!

In order to apply a texture to a shadow, you can use the following node setup as a simple starting point:

Image

Here is a more advanced example, with additional control:

Image

Do note that adjusting shadow appearance is not as straightforward as it might seem, some advanced techniques such as NGSS actually involve replacing Unity's built-in system.

Please let me know if this helps, thanks!

Re: Texture as shadows

PostPosted: Mon Apr 23, 2018 3:12 pm
by Freitas
Hi Borba :)

I tried your shader, and I cant get the texture to show in the shadows :( got the same result from one of the graph I posted before. I tested both on a empty scene and as you can see in the image below:

Image

I also tested in another scene, got same result:
Image

Shadow Quality:
Image

But with my old shader, the shadow shows up, atm this is what I have, now I just want to make this.
Image

Do you have some ideia, why the texture is not working/showing up?

Thanks again :)

Re: Texture as shadows

PostPosted: Mon Apr 23, 2018 5:50 pm
by Amplify_Borba
It might be related to your scene, could you provide us with a simple sample with the issue present so that we may debug it on our side?

Feel free to send it through [email protected] or via WeTransfer, thanks!

Re: Texture as shadows

PostPosted: Mon Apr 23, 2018 8:31 pm
by Freitas
You are right, its some kind of issue with the project, even if I create a new scene in the project, the "shadow texture" dont works.

But when I created a new project the shader works :/

Image

And I just sent the project file to [email protected]

Re: Texture as shadows

PostPosted: Tue Apr 24, 2018 10:50 am
by Amplify_Borba
Thank you for taking the time to send us a sample!

Upon testing it, the shader seems to be working as intended, although we've noticed that there were no texture set in the material so it was defaulting to white.

Image

Could you confirm on your side if setting textures on the material has the shader work as expected? Thanks!