Porting Shader From Unreal

Node-based Shader Editor

Porting Shader From Unreal

Postby zamboni » Mon Apr 02, 2018 8:51 pm

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?
zamboni
 
Posts: 7
Joined: Mon Apr 02, 2018 8:40 pm

Re: Porting Shader From Unreal

Postby Amplify_Borba » Tue Apr 03, 2018 1:17 pm

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!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: Porting Shader From Unreal

Postby zamboni » Tue Apr 03, 2018 4:19 pm

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.
Attachments
Highlight.zip
(4.66 KiB) Downloaded 248 times
zamboni
 
Posts: 7
Joined: Mon Apr 02, 2018 8:40 pm

Re: Porting Shader From Unreal

Postby Amplify_Borba » Tue Apr 03, 2018 6:11 pm

Apologies for not being more specific, but could you also provide the UE4 shader?

Thanks!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: Porting Shader From Unreal

Postby zamboni » Tue Apr 03, 2018 6:35 pm

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
zamboni
 
Posts: 7
Joined: Mon Apr 02, 2018 8:40 pm

Re: Porting Shader From Unreal

Postby Amplify_Borba » Wed Apr 04, 2018 9:38 am

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!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am


Return to Amplify Shader Editor

Who is online

Users browsing this forum: Google [Bot] and 75 guests

cron