Page 1 of 1

Converting angle cutoff shader

PostPosted: Tue Feb 12, 2019 10:15 am
by Kandob
I'm trying to convert a unity shader to an amplify shader but I can't seem to figure it out.

Here's the specific part that i'm trying to convert:
Code: Select all
float4 albedo = tex2D(_MainTex, IN.uv_MainTex) * _Color;
float DotAngle = abs(dot (IN.viewDir, IN.tangent_input));
float3 randomVec = (tex2D(_NoiseTex, IN.uv_MainTex * _noiseScale));
float randomVal = randomVec.x;

clip((1 - (_Angle / DotAngle)) + (randomVal));
clip(albedo.a - _Cutoff);


This part specifically is where i'm stuck:
Code: Select all
float3 randomVec = (tex2D(_NoiseTex, IN.uv_MainTex * _noiseScale));


This is what I have at the moment:
Image

Can anyone point me in the right direction?

Re: Converting angle cutoff shader

PostPosted: Thu Feb 14, 2019 4:51 pm
by Amplify_Borba
Hello, thank you for getting in touch and for your support!

Unfortunately, this forum is mostly aimed at tech support, and shader conversion is outside of the scope of our assistance due to our limited resources, apologies for the inconvenience.

I can share a couple of considerations though, if you intend to use random numbers on the shader it would be best to generate them through script and pass them to a shader variable, and it should also be helpful to examine the code generated by the ASE shader in order to verify if you're on the right track.

Image