Page 1 of 1

Dither & Vertex Offset Code generation Error

PostPosted: Mon Apr 02, 2018 9:23 am
by sunrice
I use dither and billboard.
ASE generate incorrect vertex code.

Simply, I test Standard Surface Shader.
'Dither' node set to 'Opacity Mask'
'float3(1,1,1)' node set to 'Vertex Offset'

Current Output is
Code: Select all
void vertexDataFunc( inout appdata_full v, out Input o )
{
   UNITY_INITIALIZE_OUTPUT( Input, o );
   float4 ase_screenPos = ComputeScreenPos( UnityObjectToClipPos( v.vertex ) );
   o.screenPosition = ase_screenPos;
   v.vertex.xyz += float3(1,1,1);
}



But, Correct code is it!
Code: Select all
void vertexDataFunc( inout appdata_full v, out Input o )
{
   UNITY_INITIALIZE_OUTPUT( Input, o );
   v.vertex.xyz += float3(1,1,1);
   float4 ase_screenPos = ComputeScreenPos( UnityObjectToClipPos( v.vertex ) );
   o.screenPosition = ase_screenPos;
}


Pls. fix this bug.

Re: Dither & Vertex Offset Code generation Error

PostPosted: Mon Apr 02, 2018 9:55 am
by sunrice
ps. If you change dither code, save 1 instruction.
Code: Select all
inline float Dither4x4Bayer( int x, int y )
{
   const float dither[ 16 ] = {
         1.0/16,  9.0/16,  3.0/16, 11.0/16,
      13.0/16,  5.0/16, 15.0/16,  7.0/16,
         4.0/16, 12.0/16,  2.0/16, 10.0/16,
      16.0/16,  8.0/16, 14.0/16,  6.0/16 };
   int r = y * 4 + x;
   return dither[r];
}

Re: Dither & Vertex Offset Code generation Error

PostPosted: Mon Apr 02, 2018 3:16 pm
by Amplify_Borba
Hello, thank you for taking the time to report this error!

We're going to fix it as soon as possible and, regarding your second post, we also appreciate that you're pointing this out and we will also be fixing its code in order to save one instruction, although Unity's compiler is able to detect it and prevent any performance hit.

Don't hesitate to get back in touch if you come across any further issues, your feedback is much appreciated!

Re: Dither & Vertex Offset Code generation Error

PostPosted: Mon Apr 16, 2018 11:11 am
by Amplify_Borba
We've just released a new build in which Vertex ports are now analyzed before fragment ones, feel free to download it through our website.

Have you had the chance to rate and review Amplify Shader Editor? It would be awesome if you could share your experience with the Unity community, the Unity Asset Store thrives on user interaction and direct feedback.
Every bit helps, your feedback is extremely valuable to us!

Thank you once again for taking the time to report this issue, happy shader creations!