Skip to main content
Added extra closing ")" to code in Step 3 to fix errors.
Source Link
user35344
user35344
inline half CustomDotClamped ( half3 a, half3 b ){ 
 #if (SHADER_TARGET < 30)
    return saturate(dot(a,b));
 #else
    return max(0.0h, dot(a,b));
#endif
}

inline half CustomLambertTerm ( half3 normal, half3 lightDir ) {
  return smoothstep(0.0,0.05f, CustomDotClamped (normal, lightDir)); //I only added 1 character but the design of this site prevents 1 character edits hence I had to also add this comment :(
}
inline half CustomDotClamped ( half3 a, half3 b ){ 
 #if (SHADER_TARGET < 30)
    return saturate(dot(a,b));
 #else
    return max(0.0h, dot(a,b));
#endif
}

inline half CustomLambertTerm ( half3 normal, half3 lightDir ) {
  return smoothstep(0.0,0.05f, CustomDotClamped (normal, lightDir)); //I only added 1 character but the design of this site prevents 1 character edits hence I had to also add this comment :(
}
inline half CustomDotClamped ( half3 a, half3 b ){ 
 #if (SHADER_TARGET < 30)
    return saturate(dot(a,b));
 #else
    return max(0.0h, dot(a,b));
#endif
}

inline half CustomLambertTerm ( half3 normal, half3 lightDir ) {
  return smoothstep(0.0,0.05f, CustomDotClamped (normal, lightDir));
}
Added extra closing ")" to code in Step 3 to fix errors. Had to also add a comment because 1 character edits are one of the many things not allowed by this site.
Source Link
inline half CustomDotClamped ( half3 a, half3 b ){ 
 #if (SHADER_TARGET < 30)
    return saturate(dot(a,b));
 #else
    return max(0.0h, dot(a,b));
#endif
}

inline half CustomLambertTerm ( half3 normal, half3 lightDir ) {
  return smoothstep(0.0,0.05f, CustomDotClamped (normal, lightDir)); //I only added 1 character but the design of this site prevents 1 character edits hence I had to also add this comment :(
}
inline half CustomDotClamped ( half3 a, half3 b ){ 
 #if (SHADER_TARGET < 30)
    return saturate(dot(a,b));
 #else
    return max(0.0h, dot(a,b));
#endif
}

inline half CustomLambertTerm ( half3 normal, half3 lightDir ) {
  return smoothstep(0.0,0.05f, CustomDotClamped (normal, lightDir);
}
inline half CustomDotClamped ( half3 a, half3 b ){ 
 #if (SHADER_TARGET < 30)
    return saturate(dot(a,b));
 #else
    return max(0.0h, dot(a,b));
#endif
}

inline half CustomLambertTerm ( half3 normal, half3 lightDir ) {
  return smoothstep(0.0,0.05f, CustomDotClamped (normal, lightDir)); //I only added 1 character but the design of this site prevents 1 character edits hence I had to also add this comment :(
}
removed forum-like commenting in favour of a simple disclaimer sentence
Source Link
Gnemlock
  • 5.3k
  • 5
  • 30
  • 60

Updated for Unity 5.5 : WORKS Note that some of the functions used here have been deprecated in Unity 5.5, but I have tested it to work.

Note : Some of the functions used here have been deprecated in Unity 5.5.

 

Updated for Unity 5.5 : WORKS

Note : Some of the functions used here have been deprecated in Unity 5.5.

Note that some of the functions used here have been deprecated in Unity 5.5, but I have tested it to work.

 
Bolded steps
Source Link
TWickz
  • 141
  • 3
Loading
Source Link
TWickz
  • 141
  • 3
Loading