Ridley5 opened this issue on Jul 26, 2010 · 1724 posts
kawecki posted Mon, 02 August 2010 at 1:03 AM
Quote - Maybe I'm misunderstanding the Lux documentation, though. Is it actually possible to create named materials and use them later. From what I saw it seemed like one always had to include the material definition directly into the attribute block (possibly using include, which would mean one file per material).
In the geometry file (lxo)
NamedMaterial "mat2"
Shape "trianglemesh" "integer indices" [
..... geometry here ....
...................... ]
NamedMaterial "floor"
Shape "trianglemesh" "integer indices" [
..... geometry here ....
...................... ]
In the material file (lxm)
# Material 'mat2'
Texture "mat2::Kd" "color" "imagemap"
"string wrap" ["repeat"]
"string filename" ["building60.jpg"]
"float gamma" [1.000000]
"float gain" [1.000000]
"string filtertype" ["bilinear"]
"string mapping" ["uv"]
"float uscale" [1.000000]
"float vscale" [-1.000000]
"float udelta" [0.000000]
"float vdelta" [-0.000000]
Texture "mat2::Kd.scale" "color" "scale" "texture tex1" ["mat2::Kd"] "color tex2" [1.00000 1.00000 1.00000]
MakeNamedMaterial "mat2"
"string type" ["glossy"] "texture Kd" ["mat2::Kd.scale"]
"color Ks" [0.005396 0.005396 0.005396] "float index" [0.0] "float uroughness" [0.250000] "float vroughness" [0.250000]
# Material 'floor'
Texture "floor::Kd" "color" "imagemap"
"string wrap" ["repeat"]
"string filename" ["floor240.jpg"]
"float gamma" [1.000000]
"float gain" [1.000000]
"string filtertype" ["bilinear"]
"string mapping" ["uv"]
"float uscale" [1.000000]
"float vscale" [-1.000000]
"float udelta" [0.000000]
"float vdelta" [-0.000000]
Texture "floor::Kd.scale" "color" "scale" "texture tex1" ["floor::Kd"] "color tex2" [1.00000 1.00000 1.00000]
MakeNamedMaterial "floor"
"string type" ["glossy"] "texture Kd" ["floor::Kd.scale"]
"color Ks" [0.010398 0.010398 0.010398] "float index" [0.0] "float uroughness" [0.250000] "float vroughness" [0.250000]
........
Stupidity also evolves!