elamhut wrote:Hey!
Here's a Unity Package with the models, textures, shaders and a prefab with everything already set up.
We use:
Color
Albedo
Metallic Alpha
Normal Map
Emissive
Detail Albedo
Detail Normal
I tried replicating each one of these in the new shader, only adding a clamped Black and White gradient that I use to fill the emissive from bottom to top in order for me to be able to animate it.
https://www.dropbox.com/s/8rwtu6j5j4a4a ... ckage?dl=0Also,
Thanks a lot for the reply and the support
Hey there,
Thank you for the sample, we really appreciate it. It seems to be working as expected provided that you compare the same exact values. The Metallic texture shared is used by the Unity counterpart as 0(black) for the metallic while the Alpha is used in the Smoothness channel, in the ASE sample you're using the Alpha as the metallic value.
We would be happy to guide you here, how exactly do you want to use the Texture to drive your Metallic and Smoothness values?
Do note that:
You don't need to use the Alpha channel of the metallic texture as you would in a standard material. If you're only using one channel you could store it pretty much anywhere. Why not combine the Emissive texture and the Metallic + Smoothness in the same file? 1 texture per-channel(RGBA) saves you quite a lot.
The
Normal textures are not used correctly, you can't simply add them. I recommend using the Blend Normals node or the Lerp node followed by a normalize.
It's definitely possible to implement a detail mask that behaves the same way as Unity standard shader detail mask, for that you need to replicate exactly what Unity is doing by using their one of their functions through a
Custom Expression node.
There are several methods available, which you can examine for yourself in the "UnityStandardInput.cginc" file, for example:
#if _DETAIL_MULX2
albedo *= LerpWhiteTo (detailAlbedo * unity_ColorSpaceDouble.rgb, mask);
#elif _DETAIL_MUL
albedo *= LerpWhiteTo (detailAlbedo, mask);
#elif _DETAIL_ADD
albedo += detailAlbedo * mask;
#elif _DETAIL_LERP
albedo = lerp (albedo, detailAlbedo, mask);
#endif
I'm sending you a shader sample which implements the first calculation, DETAIL_MULX2, in attachement with this email.
In any case, for most cases you will likely only need to Lerp or Multiply your textures to achieve similar effects.
Looking forward your reply.