Aperçu
Texture = pigments (Pigment ≈ couleur) + evt normales (Normal ≈ bosses) + evt rendu (Finish ≈ réflexion).
+ evt transformation
Textures : simple, à motif et en couches (plain, patterned, et layered).
simple = pigment simple (+ normale, rendu, transformation optionnels).
à motifs = plusieurs textures combinées par motifs ou mélange de motifs (imbriqué).
texture en couches = plusieurs textures semi transparentes superposées .
Texture simple
#declare plain =
texture { pigment { Red } normal { bumps 3.5 } finish {phong 0.8 phong_size 200}
scale 0.5 rotate 45.0 translate 1.0}
Pigments : motifs
Simple : ex: pigment {Red}
À motifs : brick, checker, hexagon, object
pigment {brick Red, Yellow };
#declare brique = pigment {brick Red, Yellow }; texture {pigment{ brique} scale 0.1}
pigment {checker Red,Yellow};
pigment { hexagon Red, Orange,Yellow};
pigment {object {sphere {<0,0,0>,0.2} Red,Yellow}}
Pigment : carte de couleurs
#declare truc = pigment { gradient x
color_map {
[0.1 color Red]
[0.3 color Yellow]
[0.6 color Blue]
[0.6 color Green]
[0.8 color Cyan]
} }
texture {pigment{ truc } scale 1.0 rotate 45 translate 0.2}
#declare carte = color_map { [0.1 color Red]
[0.3 color Yellow]
[0.6 color Blue]
[0.6 color Green]
[0.8 color Cyan]
#declare truc = pigment { gradient x
color_map {carte}
}
Pigment : carte de couleurs
pigment { bumps
color_map {
[0.25 color Red]
[0.5 color Yellow]
[0.75 color Blue]
}
scale 0.5 }
pigment { wood
color_map {
[0.0 color DarkTan]
[0.9 color DarkBrown]
[1.0 color VeryDarkBrown]
}
turbulence 0.05 scale <0.2, 0.3, 1>
}
Motifs et cartes de pigments
pigment {
gradient x
pigment_map {
[0.3 wood scale 0.2]
[0.3 Jade]
[0.6 Jade]
[0.9 Marbre turbulence 1]
} pigment {
checker
pigment { Jade } pigment { Marbre } }
Application d’images
pigment {
image_map {
jpeg "nenuphars"
filter all 0.5 }
}
Normales : carte de pentes
#declare pente = normal { gradient x
slope_map {
[0 <0, 1>] // val <val,pente>
[0.5 <1, 1>]
[0.5 <1,-1>]
[1 <0,-1>]
}
onion
wood gradient x
Normales : mélange par cartes
normal {
gradient x normal_map {
[0.3 bumps scale 0.1]
[0.3 pente]
[0.6 pente]
[0.9 marble turbulence 1]
} }
Idem avec onion
Normales : bump map
normal {bump_map {png
"Damier.png" bump_size 10.0 } }
Rendu (Finish)
finish {ambient 0.2} pigment {White}
finish {ambient rgb <0.3,0.1,0.1>}
finish {ambient 0.2 diffuse 0.7}
finish {…+phong 0.8 phong_size 50} finish {…+ specular 0.8 }
Rendu : reflexion
box{<-1,-1,0>,<1,1,0>
texture {pigment{White}
finish {reflection 1.0}
}
scale <2,2,1> rotate y*-30 }
sphere {0 1
texture { pigment{Red}
finish {
ambient 0.2 diffuse 0.7
phong 0.8 phong_size 50
} }
scale <0.5,0.5,0.5> translate <2,0,0>
UV mapping
texture{ pigment{
uv_mapping spiral1 8
color_map { [0.5 color rgb 1 ]
[0.5 color rgb <0,0,0.2> ] } }
#declare Mesh_B=
mesh2{
vertex_vectors{14
<-1, -1, -1>, < 1, -1, -1>,…, < 1, 1, 1>, -1.5*x,1.5*x,….,1.5*z }
uv_vectors{3 <0.0,0.0>, < 1.0,1.0>,< 1.0, -1.0> } uv_vectors{ 5 <0.0, 0.0>,< 1.0, 1.0>, …, <-1.0, -1.0> }
face_indices{ 24,<8,0,2>,<8,0,4>,…………}
uv_indices{ 24,<0,1,2>,<0,1,3>, ……….}
}
#declare Mesh_A=
mesh2{
vertex_vectors{ 14
<-1, -1, -1>, < 1, -1, -1>,…, < 1, 1, 1>, -1.5*x, 1.5*x,…,1.5*z, }
normal_vectors{ 14
<-1, -1, -1>, < 1, -1, -1>,…,< 1, 1, 1>, -x, x, -y, y, -z, z }
uv_vectors{3 <0.0,0.0>,< 1.0,1.0>, <1.0,-1.0>}
face_indices{24,<8,0,2>,<8,0,4>,…}
normal_indices{24,<8,0,2>,<8,0,4>,…}
uv_indices{24,<0,1,2>, <0,1,2>,…}
}
Materiau = texture + intérieur
#declare T_01 = texture { pigment { color Clear } finish { F_Glass1 } }
#declare Materiau = material { texture { T_01 } interior { I_Glass fade_color Cyan } };
Box { …texture {pigment{White}} ….}
Box { … {pigment{nenuf}} ….}
Box { …texture {T_01} ….}