Khai-J-Bach opened this issue on Aug 27, 2010 · 1684 posts
rty posted Tue, 14 September 2010 at 7:42 PM
(Sorry, a little late, replying to the person looking to make light-emitting textures some pages ago.)
Making light materials in Lux is a little more involved, as they aren't really materials, and you need to mostly/also declare them as lights in the geometry (.lxo file). Usually you find inside the .lxo file just a simple declaration like
AttributeBegin<br></br>
NamedMaterial "MyMaterialName"
(followed by other stuff)
You'll need to replace those two lines with something like:
LightGroup "MyTextureLightGroup"
AreaLightSource "area" "color L" [1.0.0 0.0]
"float power" [100.0]
"float efficacy" [10.0]
"float gain" [1.0]
That would give a red light texture inside a light group named "MyTextureLightGroup" (Important! That way you can tweak them inside Lux afterwards!).
Caveat: Make backups! Make a copy of the clean file before starting to edit it!
Now you can also attempt to deport the material part into the materials (.lxm) file, by writing inside the geometry just
LightGroup
"<strong>MyTextureLightGroup</strong>"<br></br>
AreaLightSource "area" "texture L"
["<strong>MyMaterial</strong>:light:L"]<br></br>
"float power" [100.0]<br></br>
"float efficacy" [10.0]<br></br>
"float gain" [1.0]
...and adding inside .lxm the values for the material named "MyMaterial", like that:
Texture "<strong>MyMaterial</strong>:light:L"
"color" "blackbody"<br></br>
"float temperature" [6500]
(That BTW, is how a black body light looks like).
You note there is no "MakeNamedMaterial" declaration, as for all other materials - Light materials aren't materials.
Now you can of course also go wild with those light materials. Here is a (pretty IMHO) light texture randomly mixing red and green light using a fbm noise node (same one we have in Poser). If you have followed till here the syntax should be pretty simple to tweak according to your needs:
Texture "MyMaterial:light:L::amount"
"float" "fbm"<br></br>
"integer octaves" [12]<br></br>
"float roughness" [0.6]<br></br>
"vector scale" [1.0 1.0 1.0]<br></br>
"vector rotate" [0 0 0]<br></br>
"vector translate" [0 0 0]Texture
"MyMaterial:light:L" "color" "mix"
"texture amount" ["MyMaterial:light:L::amount"]
"color tex1" [1.0 0.0 0.0] "color tex2" [0.0
1.0 0.0]
Could come handy for magical swirly colored light things.
Note that each light emitting polygon is considered a separate light for Lux's raytracing calculations, so apply Light materials only to simple geometry, lest your render takes ages.