Since most of the images
atmosphere would be based on the rainy effect, it was of the utmost importance to have a
sidewalk and street texture that would reflect the light in a realistic way. I needed
patches of darkness with a variable reflection. I thought that to do it procedurally was a
nonsense, so I turned to my favourite painting programme instead. First, I drew a pattern of rectangles of varying grey intensities. This image image was used as a basis for two images : (1) a contour filter provided the height field itself (the cracks following the rectangles outline) ; (2) the blurred and slightly distorted image was used as an image pattern for the sidewalk texture. These images are shown on the right at 20% of their original size : The texture is a texture map mixing, through the image_pattern pattern (a feature available in Megapov and possible in POV 3.5), two textures with different finishes (variable reflection and normal). The "wet" effect was obtained by averaging several normal statements (a bump_map) of different sizes. The several layers of normals are used to simulate reflection blurring. I had tried reflection blurring first but it was too slow for the purpose so I used the classic technique instead. Here is the code : |
#declare c10=color
rgb<0.95,0.86,0.5>;
#declare bsize=0.3;
#declare N1=normal{bump_map{png "bitmaps\normalsw"} bump_size bsize
turbulence 0.3 scale 10000}
#declare N2=normal{bozo bsize turbulence 1 scale 0.001}
#declare N3=normal{bozo bsize turbulence 1 scale 0.01}
#declare N4=normal{bozo bsize turbulence 1 scale 0.1}
#declare N5=normal{bozo bsize turbulence 1 scale 1}
#declare txtSW1=texture{
pigment{c10*0.1}
normal{average normal_map {[2.0 N1][1 N2][1 N3][1 N4][1 N5]}}
finish{ambient 0 diffuse 0.02 specular 0.002 roughness 0.1
metallic 2 reflect_metallic reflection_type 1 reflection_min 0.0
reflection_max 1 reflection_falloff 6 conserve_energy
}
}
#declare txtSW2=texture{
pigment{c10*0.1}
normal{average normal_map {[1 N2][1 N3][0.4 N4][0.2 N5]} scale 3}
finish{ambient 0 diffuse 0.02 specular 0.002 roughness 0.1
reflection 0.1 reflect_metallic
}
}
#declare txtStr1=texture{
pigment{c10*0.01}
normal{average normal_map {[2.0 N1][1 N2][1 N3][1 N4][2 N5]}}
finish{ambient 0 diffuse 0 specular 0.002 roughness 0.1
reflect_metallic reflection_type 1 reflection_min 0.0
reflection_max 0.7 reflection_falloff 6 conserve_energy
}
}
#declare txtStr2=texture{
pigment{c10*0.01}
normal{average normal_map {[1 N2][1 N3][0.4 N4][0.2 N5]} scale 3}
finish{ambient 0 diffuse 0 specular 0.002 roughness 0.1
reflection 0.1 reflect_metallic
}
}
#declare matSW=material{
texture {
image_pattern { png "bitmaps\swmap" }
turbulence 0.01
texture_map {[0 txtSW1 scale <1/xSW,1/zSW,1>][1 txtSW2 scale
<1/xSW,1/zSW,1>]}
scale <xSW,zSW,1> rotate x*90
}
interior{ior 1.33}
}
This material was applied to the side walk height-field, and then this element was replicated several times to form the whole sidewalk.
Later on, I drew some random trash elements with sPatch, exported them as DXF, converted them to meshes with Crossroads and arranged the trash randomly with a while loop.
The street is an isosurface plane with noise3d. Its texture is similar to the sidewalk's. The crossing marks are made with height fields and isosurfaces.