I have been reading and writing both GLSL and CG for the past few years, and have noticed a trend. In programming, we are generally advised to be as meaningful and concise as possible with variable names, but I see this suggestion being ignored almost every time I look at shaders.
Here is a random example I grabbed off of Shadertoy:
vec3 tex_wmcs(vec2 p)
{
float s=mix(0.2,1.2,sqrt(smoothNoise2(p*3.0)));
vec3 col=mix(vec3(0.15,0.2,0.2)*0.4,vec3(0.2,0.15,0.11)*0.7*s,sqrt(max(0.0,sm...
vec2 p2=p*vec2(4.0,10.0)+vec2(smoothNoise2(p*24.0),smoothNoise2...
p2.x+=floor(p2.y)*0.5;
float bh=pow(0.5+0.5*cos(floor(p2.y)*14.0)*cos(floor(p2.x)*1.0),2.0);
float brick=brickt(p2);
vec3 bn=normalize(vec3(brickt(p2+vec2(1e-3,0.0))-brick,b...
...
}
Is there a practical reason so many graphics programmers minify their code to such a point?
Is there a technical downside to spelling out brickNormal instead of leaving it as bn, or using brick_tangent or brickTexture instead of brickt?