I used one displacement shader and two surface shaders to render this scene. The wall uses a displacement shader for a vertical striped bumpy surface. The floor uses a surface shader that generates a reflective checkerboard surface. The last shader was a zDepth shader which I used to to simulate camera focus and environmental fog.
Wall Shader:
displacement noisy_walls(
float Km = 0.1;
float noiFreq = 2.75;
float stripes = .001;
)
{float noi;
noi = noise(transform(“shader”,P*noiFreq));
float stripe_freq = 1.0 / stripes;
float smod = mod( s*stripe_freq, 1);if ( smod > 0.5 ){
P += normalize(N) * noi * Km;
N = calculatenormal(P);}
else {N = calculatenormal(P);
}
}
Floor shader:
surface checkerboard( float checkersize_x = 5;
float checkersize_y = 5;
color color_one = color (1,1,1);
color color_two = color (0,0,0);
color specular_color = color(1,1,1);
float Ka = 0.5;
float Kd = 0.5;
float Ks = 1;
float Kr = 0.5;
float roughness = 0.2;
)
{float checkerfreq_x = 1.0 / checkersize_x;
float checkerfreq_y = 1.0 / checkersize_y;
vector Nn = normalize(N);
vector V = normalize(I);float smod = mod(s * checkerfreq_x, 1);
float tmod = mod(t * checkerfreq_y, 1);color Cc;
if( smod < 0.5 )
{
if( tmod < 0.5 )
{
Cc = color_one;
}
else
{
Cc = color_two;
}
}
else
{
if( tmod < 0.5 )
{
Cc = color_two;
}
else
{
Cc = color_one;
}
}Ci = ((1-Kr) * (Cc * ((Kd * diffuse(Nn)) + Ka + (specular_color * Ks * specular(Nn,V,roughness))))) + (Kr * trace(P,reflect(V,Nn)));
Oi = 1;}
zDepth Shader:
surface zdepth( float max_distance = 40;
float min_distance = 0;
color color_one = 0;
color color_two = 1;
)
{float dist_from_eye = abs(distance(E,P));
Oi = 1;
float step = smoothstep(min_distance,max_distance,dist_from_eye);
Ci = mix(color_one,color_two,step);}
The following are textures I used
Wall Texture:
Counter Texture:
Wood Texture:
Cushion Texture:
The following are render passes
Base Render:
zDepth Pass:
Final Composite:








































































