I still don't know HLSL too well, but I'm starting to like messing around with it. I thought I'd share a simple method for smoother shade transitions (if you want them).
I basically slightly modified the code to get continuous intensity variation for certain intensities. I tried it on RB's helicopter model and kind of liked the results.
// Discretize the intensity, based on a few cutoff points
//Uniform
if (intensity > 0.95)
color = float4(1.0,1,1,1.0) * color;
//Continuous
else if(intensity>=.9 && intensity<=.95)
color = float4((intensity-.9)*20*.3+.7,(intensity-.9)*20*.3+.7,(intensity-.9)*20*.3+.7,1.0) * color;
//Uniform
else if (intensity > 0.5)
color = float4(0.7,0.7,0.7,1.0) * color;
//Continuous
else if(intensity>=.45 && intensity<=.5)
color = float4((intensity-.45)*20*.35+.35,(intensity-.45)*20*.35+.35,(intensity-.45)*20*.35+.35,1.0) * color;
//Uniform
else if (intensity > 0.2)
color = float4(0.35,0.35,0.35,1.0) * color;
//Continuous
else if(intensity>=.18 && intensity<=.2)
color = float4((intensity-.18)*50*.15+.2,(intensity-.18)*50*.15+.2,(intensity-.18)*50*.15+.2,1.0) * color;
//Uniform
else
color = float4(0.2,0.2,0.2,1.0) * color;
return color;
It isn't always noticeable, but you can probably mess around with the values to increase or decrease the size of the transitional areas

