Page 1 of 1

Porting Shader From Unreal

PostPosted: Mon Apr 02, 2018 8:51 pm
by zamboni
I'm quite new to unity shaders, newer still to Amplify Shader Editor, and there's a shader I'd like to port from Unreal.

The shader should be applied to a sphere object, and will highlight all intersecting geometry.

I've seemingly placed the same nodes as I had in UE4, yet the output is not the same. I was wondering if I had chosen the wrong option for something?

Here are my nodes
Image

Extra Settings:
Render Mode/Queue Transparent
Cull Off
ZTest Always

Here are the same nodes in UE4
Image

Settings:
Two-sided
Allow Custom Depth Writes
Render CustomDepth
Disable Depth Test


This is the expected result
Image

But what I get in Unity is a fully transparent sphere.

Does UE4's sphere mask work differently from the one provided by ASE?
Or perhaps am I using the wrong node for something?

Re: Porting Shader From Unreal

PostPosted: Tue Apr 03, 2018 1:17 pm
by Amplify_Borba
Hello, thank you for getting in touch!

A few notes regarding the information you shared, our Sphere Mask function should work similarly to UE4's material function, we don't currently support Render CustomDepth for surface shaders, and since Depth Test is disabled, ZWrite needs to be Off.

If you're still having trouble getting the intended results, please send us your shader together with the functions being used as an attachment to your reply or via [email protected] so that we can examine it on our side, thanks!

Re: Porting Shader From Unreal

PostPosted: Tue Apr 03, 2018 4:19 pm
by zamboni
Sure thing, I've attached the shader and its material, along with the material functions.
I did modify SphereMask to behave a bit more like UE4's version, but only by replacing an input.

Re: Porting Shader From Unreal

PostPosted: Tue Apr 03, 2018 6:11 pm
by Amplify_Borba
Apologies for not being more specific, but could you also provide the UE4 shader?

Thanks!

Re: Porting Shader From Unreal

PostPosted: Tue Apr 03, 2018 6:35 pm
by zamboni
Thanks for the reply, but I actually figured it out. It was an issue of my units!
I changed "Hardness" to 200, and "Radius" to 0.5.
Then I also changed the opacity to 1 - SphereMask's output, now it works great!

Image

Re: Porting Shader From Unreal

PostPosted: Wed Apr 04, 2018 9:38 am
by Amplify_Borba
Glad to know you've managed to sort it out, thank you for reporting back to us with your findings.

Don't hesitate to get back in touch if you have any further questions or issues, thanks!