Not a real tutorial but a guide, or something like that.
Anyway the sad thing is that the medium of Blogging has not caught up with POV-Ray SDL formatting I like to use ( lots of tabs ) so sadly all my nicely laid out code has had to be compressed and streamlined to fit on the blog. Sad.
The code below shows the process I followed recently when I wanted to make the bottom of a wall, dirty. You know, when all the splash and muck splats along the bottom of a wall.
This scene shows the basic stages of texturing the wall. If you render the scene as is, then change the value allocated to "stage" from 1 to 2 and render again you'll see what change I made. You change the value of thru the range 1 to 9, as I've included 9 main stages in building the texture. I've included comments in the code so that you can see what I've changed and why.
#include "colors.inc"
camera{location <0,1.2,-5>look_at<0,1,0>}
light_source {<-50,100,-50>color White}
background { color <0.25,0.35,0.80> }
plane {y, -1 pigment{color rgb <0.7,0.5,0.3>}}
#declare stage = 1; //change from 1 through 9
// basic brick texture to start with
#if(stage=1)
#declare wallTexture = texture {pigment {brick}};
#end
// shrink the brick pattern as its too big
#if(stage=2)
#declare wallTexture = texture {pigment {brick scale .2}};
#end
// add in the second texture that will be the mud/dirt
#if(stage=3)
#declare wallTexture = texture {pigment {brick scale .2}}
texture {pigment {marble // parralel lines of colour
pigment_map {
[0 Clear] // transparent
[1 Black] // muddy color}}};
#end
#if(stage=4)
#declare wallTexture = texture {pigment {brick scale .2}}
texture {
pigment {
marble rotate <0,0,90>// rotate pattern so it lines up with floor
pigment_map {[0 Clear][1 Black]}}};
#end
#if(stage=5)
#declare wallTexture = texture {pigment {brick scale .2}}
texture {pigment {
marble rotate <0,0,90>
scale 5 // enlarge the pattern
pigment_map {[0 Clear][1 Black]}}};
#end
#if(stage=6)
#declare wallTexture = texture {pigment {brick scale .2}}
texture {
pigment {
marble
rotate <0,0,90>
scale 5
translate <0,1.4,0> //translate the pattern so densest part is on the floor
pigment_map {
[0 Clear]
[1 Black]}}};
#end
#if(stage=7)
#declare wallTexture = texture {pigment {brick scale .2}}
texture {
pigment {
marble
rotate <0,0,90>
scale 5
translate <0,1.4,0>
pigment_map {
[0 Clear]
[.6 Clear]// extend Clear area
[.9 Black] // extend the solid part
[1 Black]}}};
#end
#if(stage=8)
#declare wallTexture = texture {pigment {brick scale .2}}
texture {
pigment {
marble
rotate <0,0,90>
scale 5
translate <0,1.4,0>
warp{turbulence <0,.5,0> } // turbulate the pattern
pigment_map {
[0 Clear]
[.6 Clear]
[.9 Black]
[1 Black]}}};
#end
#if(stage=9)
#declare wallTexture = texture {pigment {brick scale .2}}
texture {
pigment {
marble
rotate <0,0,90>
scale 5
translate <0,1.4,0>
warp{turbulence <0,.5,0> }
warp{turbulence <1,0,1> } // additional turbulence 'cos I had to tinker
pigment_map {
[0 Clear]
[.6 Clear]
[.9 Black]
[1 Black]}}};
#end
box {<-2,-1,0>,<2,2,.1>texture { wallTexture }}