XML Scripts for Materials

XML Scripts for Materials

These contributions are works in progress... some are finished materials. Copy and paste these definitions into your text editor and save it with an .xml extension. They can then be loaded into Pose2Lux via the Menu Option: File -> Load material library.


SnarlyGribbly:
This is AyaneMatrix's 'rough leather' texture from the LuxPose entry on the Wiki, slightly modified because the original used the deprecated 'glossy_lossy' material. I have converted it to the newer 'glossy' material.

<P2LLib>
    <library name="Leather">
   
        <material name="Rough Leather" type="glossy">
            <input>"texture Kd" ["Leather/rough_leather::Kd"]</input>
            <input>"color Ks" [0.028991 0.028991 0.028991]</input>
            <input>"float index" [0.0]</input>
            <input>"float uroughness" [0.033333]</input>
            <input>"float vroughness" [0.033333]</input>
            <input>"texture bumpmap" ["Leather/rough_leather::bumpmap.scale"]</input>
            <input>"bool multibounce" ["true"]</input>
           
            <used_texture>Leather/rough_leather::Kd::amount</used_texture>
            <used_texture>Leather/rough_leather::Kd</used_texture>
            <used_texture>Leather/rough_leather::bumpmap</used_texture>
            <used_texture>Leather/rough_leather::bumpmap.scale</used_texture>
           
        </material>
       
        <texture name="rough_leather::Kd::amount" type="float" value="blender_clouds">
            <input>"string type" ["default"]</input>
            <input>"string noisetype" ["soft_noise"]</input>
            <input>"float noisesize" [0.100000]</input>
            <input>"integer noisedepth" [6]</input>
            <input>"string noisebasis" ["improved_perlin"]</input>
            <input>"float bright" [1.000000]</input>
            <input>"float contrast" [2.000000]</input>
            <input>"vector scale" [0.050000 0.050000 0.050000]</input>
            <input>"vector rotate" [0 0 0]</input>
            <input>"vector translate" [0 0 0]</input>
        </texture>
       
        <texture name="rough_leather::Kd" type="color" value="mix">
            <input>"texture amount" ["Leather/rough_leather::Kd::amount"]</input>
            <input>"color tex1" [0.090444 0.038903 0.038903]</input>
            <input>"color tex2" [0.013517 0.000159 0.000159]</input>
        </texture>
       
        <texture name="rough_leather::bumpmap" type="float" value="blender_clouds">
            <input>"string type" ["default"]</input>
            <input>"string noisetype" ["hard_noise"]</input>
            <input>"float noisesize" [0.050000]</input>
            <input>"integer noisedepth" [6]</input>
            <input>"string noisebasis" ["voronoi_crackle"]</input>
            <input>"float bright" [1.000000]</input>
            <input>"float contrast" [1.000000]</input>
            <input>"vector scale" [0.050000 0.050000 0.050000]</input>
            <input>"vector rotate" [0 0 0]</input>
            <input>"vector translate" [-0.000000 -0.000000 -0.000000]</input>
            <input>"float tex1" [0.0]</input>
            <input>"float tex2" [1.0]</input>
        </texture>
       
        <texture name="rough_leather::bumpmap.scale" type="float" value="scale">
            <input>"texture tex1" ["Leather/rough_leather::bumpmap"]</input>
            <input>"float tex2" [0.0010000000475]</input>
        </texture>
       
    </library>
</P2LLib>


LaurieA:
Here's the green gel from the wiki page. It works. I checked ;o):

<P2Llib>
    <library name="GreenGel">
       
        <material name="GreenGel@glass" type="glass" show="no">
            <parameters USE_KdMAP="no" USE_KD="no" USE_KS="no" USE_BUMPMAP="no" USE_KR="no"/>
            <input>"color Kr" [0.95 0.95 0.95] </input>
            <input>"color Kt" [0.0 0.5 0.2] </input>
            <input>"float index" [1.4] </input>
            <input>"float cauchyb" [0.1] </input>
        </material>
       
        <material name="GreenGel@mattetranslucent" type="mattetranslucent" show="no">
            <parameters USE_KdMAP="no" USE_KD="no" USE_KS="no" USE_BUMPMAP="no" USE_KR="no"/><parameters USE_KdMAP="no" USE_KD="no" USE_KS="no" USE_BUMPMAP="no" USE_KR="no"/>
            <input>"color Kr" [0.0 0.5 0.2]</input>
            <input>"color Kt" [0.0 0.5 0.2]</input>
            <input>"float sigma" [1.0] </input>
        </material>
   
        <material name="GreenGel" type="mix">
            <mix_1>GreenGel@glass</mix_1>
            <mix_2>GreenGel@mattetranslucent</mix_2>
            <mix_amount>0.2</mix_amount>
        </material>
       
    </library>
</P2Llib>


AyaneMatrix:
Car Paint (tweaked by Snarly)

<P2LLib>
    <library name="More car paint">
  
    <material name="Green Car Paint" type="carpaint">

        <input>"color Kd" [0.124526 0.294963 0.203289]</input>
        <input>"color Ks1" [0.754852 0.773852 0.500392]</input>
        <input>"color Ks2" [0.442047 0.629024 0.290352]</input>
        <input>"color Ks3" [0.227329 0.546751 0.374624]</input>
        <input>"float R1" [1.000000]</input>
        <input>"float R2" [1.000000]</input>
        <input>"float R3" [1.000000]</input>
        <input>"float M1" [1.000000]</input>
        <input>"float M2" [1.000000]</input>
        <input>"float M3" [1.000000]</input>

    </material>
  
    </library>
</P2LLib>


 Snarlygribbly (and LaurieA):

I like this green gel! Here's a more general purpose variant:

<P2Llib>
    <library name="Gel">
       
        <material name="Gel@glass" type="glass" show="no">
            <parameters USE_KdMAP="no" USE_KD="no" USE_KS="no" USE_BUMPMAP="no" USE_KR="no"/>
            <input>"color Kr" [0.95 0.95 0.95] </input>
            <input>"color Kt" [USE_KD] </input>
            <input>"float index" [1.4] </input>
            <input>"float cauchyb" [0.1] </input>
        </material>
       
        <material name="Gel@mattetranslucent" type="mattetranslucent" show="no">
            <parameters USE_KdMAP="no" USE_KD="no" USE_KS="no" USE_BUMPMAP="no" USE_KR="no"/>
            <input>"color Kr" [USE_KD]</input>
            <input>"color Kt" [USE_KD]</input>
            <input>"float sigma" [1.0] </input>
        </material>
   
        <material name="Gel" type="mix">
            <mix_1>Gel@glass</mix_1>
            <mix_2>Gel@mattetranslucent</mix_2>
            <mix_amount>0.2</mix_amount>
        </material>
       
    </library>
</P2Llib>


SnarlyGribbly:
In answer to LaurieA's question:

"Does anyone know the Luxrender parameters for SSS and glossy translucent? Pretty please? ;o)

Laurie"

SSS isn't so straightforward - I'll come back to that. Glossy translucent is explained in the Wiki here. As a Pose2Lux library file it looks like this (with fixed bumpMap):

<P2Llib>
    <library name="Glossy Translucent">
       
        <material name="Glossy translucent" type="glossytranslucent">
            <input>"color Kd" [USE_KD] </input>
            <input>"color Kt" [USE_KD] </input>
            <input>"color Ks" [USE_KS] </input>
            <input>"float uroughness" [0.1]</input>
            <input>"float vroughness" [0.1]</input>
            <input>"color Ka" [0.0 0.0 0.0] </input>
            <input>"float d" [0.0]</input>
            <input>"float index" [0.0]</input>
            <input>"bool multibounce" ["false"]</input>
            <input>"texture bumpmap" [USE_BUMPMAP]</input>
            <input>"bool onesided" ["true"]</input>
        </material>
       
    </library>
</P2Llib>


SnarlyGribbly:
Here is an example of the use of volumes in an XML file for import into Pose2Lux. This is an example of lake water. Change the <displacementscale> parameter in the 'Lake water' material to change how 'choppy' the water is. Values from 0 to 2 will give optimal results.

<P2Llib>
    <library name="Examples">
       
        <material name="Lake water" type="glass2">
            <input>"bool architectural" ["false"]</input>
            <input>"bool dispersion" ["false"]</input>
            <usevolume>Examples/clearwater</usevolume>
            <displacement>Examples/water@scale</displacement>
            <displacementscale>0.5</displacementscale>
            <sharpboundary>False</sharpboundary>
           
            <used_texture>Examples/water@disp</used_texture>
            <used_texture>Examples/water@scale</used_texture>
        </material>
       
        <volume name="clearwater" type="clear">
            <input>"texture fresnel" ["Examples/water"]</input>
            <input>"color absorption" [0 0 0]</input>
            <used_texture>Examples/water</used_texture>
        </volume>
       
        <texture name="water" type="fresnel" value="constant">
            <input>"float value" [1.33]</input>
        </texture>
       
        <texture name="water@disp" type="float" value="blender_distortednoise">
            <input>"float distamount" [1.6]</input>
            <input>"float noisesize" [0.25]</input>
            <input>"float nabla" [0.025]</input>
            <input>"string type" ["blender_original"]</input>
            <input>"string noisebasis" ["blender_original"]</input>
            <input>"float bright" [1.0]</input>
            <input>"float contrast" [0.5]</input>
            <input>"vector scale" [1.0 1.0 1.0]</input>
            <input>"vector rotate" [0 0 0]</input>
            <input>"vector translate" [0 0 0]</input>
        </texture>
       
        <texture name="water@scale" type="float" value="scale">
            <input>"texture tex1" ["Examples/water@disp"]</input>
            <input>"float tex2" [0.1]</input>
        </texture>
   
    </library>
</P2Llib>

Some notes:

  • The inputs <displacement>, <displacementscale> and <sharpboundary> override any displacement settings in the Material's shader, enabling you to implement procedural displacement.
  • Only use one <usevolume> input per material.
  • For water to look correct in Lux it MUST have an environment - a lake bed and banks. The water surface is not textured like Poser water: it needs something to be underneath it to look right!

 

...