Dither & Vertex Offset Code generation Error

Node-based Shader Editor

Dither & Vertex Offset Code generation Error

Postby sunrice » Mon Apr 02, 2018 9:23 am

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.
Last edited by sunrice on Mon Apr 02, 2018 9:58 am, edited 1 time in total.
sunrice
 
Posts: 14
Joined: Fri Nov 24, 2017 10:27 am

Re: Dither & Vertex Offset Code generation Error

Postby sunrice » Mon Apr 02, 2018 9:55 am

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];
}
sunrice
 
Posts: 14
Joined: Fri Nov 24, 2017 10:27 am

Re: Dither & Vertex Offset Code generation Error

Postby Amplify_Borba » Mon Apr 02, 2018 3:16 pm

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!
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: Dither & Vertex Offset Code generation Error

Postby Amplify_Borba » Mon Apr 16, 2018 11:11 am

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!
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: No registered users and 0 guests