<world>

    <variables>
        <variable name="LodM" value="-0.00666667" />
        <variable name="LodA" value="1.33333" />
    </variables>

    <plugins>
        <plugin name="genmesh">crystalspace.mesh.loader.genmesh</plugin>
        <plugin name="genmeshfact">crystalspace.mesh.loader.factory.genmesh</plugin>
        <plugin name="emitFact">crystalspace.mesh.loader.factory.emit</plugin>
        <plugin name="emit">crystalspace.mesh.loader.emit</plugin>
    </plugins>

    <shaders>
        <shader>
            <file>/shader/lighting/fullbright_fixed.xml</file>
        </shader>
        <shader>
            <file>/shader/particles/basic.xml</file>
        </shader>
        <shader>
            <file>/shader/early_z/z_only_instanced.xml</file>
        </shader>
        <shader>
            <file>/shader/lighting/fullbright_instance.xml</file>
        </shader>
        <shader>
            <file>/shader/lighting/lighting_default_instance.xml</file>
        </shader>
        <shader>
            <file>/shader/lighting/lighting_default_instance_binalpha.xml</file>
        </shader>
    </shaders>

    <textures>
        <texture name="fp2">
            <file>/lib/stdtex/fp2.png</file>
        </texture>
        <texture name="prop_mushrooms_001_co">
            <file>textures/prop_mushrooms_001_col.dds</file>
        </texture>
        <texture name="prop_plants_groun.007">
            <file>textures/prop_plants_ground_002_col.png</file>
            <alpha>
                <binary />
            </alpha>
        </texture>
        <texture name="trees_bark_002_col.pn">
            <file>textures/trees_bark_002_col.dds</file>
        </texture>
        <texture name="trees_leaves_003_col.">
            <file>textures/trees_leaves_003_col.dds</file>
            <alpha>
                <binary />
            </alpha>
        </texture>
        <texture name="prop_rocks_rock_002_c">
            <file>textures/prop_rocks_rock_002_col.dds</file>
        </texture>
    </textures>

    <materials>
        <material name="sky_001">
            <texture>sky_001.dds</texture>
            <shader type="base">lighting_fullbright_fixed</shader>
            <shader type="diffuse">*null</shader>
        </material>
        <material name="fp2">
            <texture>fp2</texture>
            <shader type="diffuse">*null</shader>
            <shader type="ambient">particles_basic</shader>
        </material>
        <material name="mushrooms1">
            <texture>prop_mushrooms_001_co</texture>
            <shader type="oc_depthwrite">*null</shader>
            <shader type="oc_depthtest">z_only_instanced</shader>
            <shader type="base">lighting_default_instance_binalpha</shader>
            <shader type="diffuse">lighting_default_instance_binalpha</shader>
        </material>
        <material name="plants1">
            <texture>prop_plants_groun.007</texture>
            <shader type="oc_depthwrite">*null</shader>
            <shader type="oc_depthtest">z_only_instanced</shader>
            <shader type="base">lighting_default_instance_binalpha</shader>
            <shader type="diffuse">lighting_default_instance_binalpha</shader>
        </material>
        <material name="tree_brown">
            <texture>trees_bark_002_col.pn</texture>
            <shader type="oc_depthwrite">*null</shader>
            <shader type="oc_depthtest">z_only_instanced</shader>
            <shader type="base">lighting_default_instance_binalpha</shader>
            <shader type="diffuse">lighting_default_instance_binalpha</shader>
        </material>
        <material name="rocks_rock_02">
            <texture>prop_rocks_rock_002_c</texture>
            <shader type="oc_depthwrite">*null</shader>
            <shader type="oc_depthtest">z_only_instanced</shader>
            <shader type="base">lighting_default_instance_binalpha</shader>
            <shader type="diffuse">lighting_default_instance_binalpha</shader>
        </material>
    </materials>

    <library>terrain.cslib</library>
    <library>factories/skydome_frankieisland_SkyDome</library>
    <library>factories/ground</library>
    <library>factories/water</library>
    <library>factories/mushroom_or_001.004_mushroom_red_001mushroom_red_001_mushroom_red_001</library>
    <library>factories/flowers_purple_01.015_flower_001.124flowers_s_white_01_flower_001.020</library>
    <library>factories/tree_generic_001.027_treebrown_002tree_generic_002_treebrown_002</library>
    <library>factories/rocks_01.075_rocks_rock_02rocks_02_Circle.001</library>
    <library>/lev/terrainf/grass.lib</library>

    <meshfact name="emitFact">
        <plugin>emitFact</plugin>
        <params />
    </meshfact>

    <start name="start_position">
        <sector>TerrainSector</sector>
	<position x="637.623" y="74.9038" z="-104.723" />
    	<up x="0.0119134" y="0.999872" z="-0.0106786" />
    	<forward x="-0.744546" y="0.0159989" z="0.667377" />
    </start>

    <sector name="TerrainSector">

        <cullerp plugin="crystalspace.culling.frustvis"/>

        <light name="sun">
            <center x="-50000" y="86030" z="0" />
            <color red="1.25903" green="1.20995" blue="1.10420" />
            <radius>1000000</radius>
        </light>

        <meshobj name="Terrain">
            <plugin>crystalspace.mesh.loader.terrain2</plugin>
            <params>
                <factory>island</factory>
            </params>
            <move>
                <v x="0" y="0" z="0" />
            </move>
            <priority>wall</priority>
        </meshobj>

        <meshobj name="skydome_frankieisland_SkyDome">
            <plugin>genmesh</plugin>
            <params>
                <factory>skydome_frankieisland_SkyDome</factory>
            </params>
            <trimesh>
                <id>shadows</id>
            </trimesh>
            <zuse />
            <noshadows />
            <noshadowreceive />
            <move>
                <v x="5000" y="0" z="5000" />
            </move>
            <priority>sky</priority>
        </meshobj>

        <meshobj name="water">
            <plugin>genmesh</plugin>
            <noshadowcast />
            <priority>object2</priority>
            <params>
                <factory>water</factory>
            </params>
            <trimesh>
                <id>colldet</id>
            </trimesh>
            <move>
                <v x="0.0" y="50.0" z="0.0" />
            </move>
            <zuse />
        </meshobj>

        <meshobj name="ground">
            <plugin>genmesh</plugin>
            <priority>wall</priority>
            <params>
                <factory>ground</factory>
            </params>
            <trimesh>
                <id>colldet</id>
            </trimesh>
            <zuse />
            <move>
                <v x="0.0" y="38.0" z="0.0" />
            </move>
        </meshobj>

        <meshobj name="volcano_smoke">
            <priority>alpha</priority>
            <plugin>emit</plugin>
            <ztest />
            <move>
                <v x="165.7" y="136.2" z="300.9" />
            </move>
            <params>
                <factory>emitFact</factory>
                <mixmode>
                    <copy />
                </mixmode>
                <number>30</number>
                <material>fp2</material>
                <regularparticles sides="8" radius="9" />
                <lighting>no</lighting>
                <totaltime>30000</totaltime>
                <startpos>
                    <emitsphere x="0" y="0.5" z="0" p="0" q="4" />
                </startpos>
                <startspeed>
                    <emitsphere x="-0.3" y="0" z="0" p="0" q="3" />
                </startspeed>
                <startaccel>
                    <emitfixed x="0" y="0.2" z="0" />
                </startaccel>
                <attractor>
                    <emitcone x="0" y="-100.0" z="0" p="-0.7" q="0" r=".4" s="0" t="300" />
                </attractor>
                <attractorforce>-0.001</attractorforce>
                <aging>
                    <color red="1" green="1" blue="1" />
                    <time>0</time>
                    <alpha>1</alpha>
                    <swirl>0</swirl>
                    <rotspeed>0</rotspeed>
                    <scale>0.5</scale>
                </aging>
                <aging>
                    <color red="1" green="1" blue="1" />
                    <time>50</time>
                    <alpha>0</alpha>
                    <swirl>0.1</swirl>
                    <rotspeed>0</rotspeed>
                    <scale>0.5</scale>
                </aging>
                <aging>
                    <color red="1" green="1" blue="0.2" />
                    <time>150</time>
                    <alpha>0.2</alpha>
                    <swirl>0.1</swirl>
                    <rotspeed>1</rotspeed>
                    <scale>1</scale>
                </aging>
                <aging>
                    <color red="1" green="0.5" blue="0.2" />
                    <time>250</time>
                    <alpha>0.5</alpha>
                    <swirl>0.1</swirl>
                    <rotspeed>1</rotspeed>
                    <scale>0.8</scale>
                </aging>
                <aging>
                    <color red="0.2" green="0.2" blue="0.2" />
                    <time>300</time>
                    <alpha>0.5</alpha>
                    <swirl>0</swirl>
                    <rotspeed>0.7</rotspeed>
                    <scale>1.5</scale>
                </aging>
                <aging>
                    <color red="0" green="0" blue="0" />
                    <time>1500</time>
                    <alpha>0.4</alpha>
                    <swirl>0</swirl>
                    <rotspeed>0.6</rotspeed>
                    <scale>1.5</scale>
                </aging>
                <aging>
                    <color red="0" green="0" blue="0" />
                    <time>30000</time>
                    <alpha>1</alpha>
                    <swirl>0</swirl>
                    <rotspeed>0</rotspeed>
                    <scale>10</scale>
                </aging>
            </params>
        </meshobj>

        <meshgen name="terrain_foliage">
            <densityfactormap name="fertile">
                <image>meshmaps/terrain_fertile.png</image>
                <world2image>
                    <m11>0.001953125</m11>
                    <m12>0</m12>
                    <m13>0</m13>
                    <m14>0</m14>
                    <m21>0</m21>
                    <m22>0</m22>
                    <m23>0.001953125</m23>
                    <m24>0</m24>
                    <m31>0</m31>
                    <m32>0</m32>
                    <m33>0</m33>
                    <m34>0</m34>
                    <m41>0</m41>
                    <m42>0</m42>
                    <m43>0</m43>
                    <m44>0</m44>
                </world2image>
            </densityfactormap>
            <geometry>
                <factory maxdist="35" name="flowers_purple_01.015_flower_001.124flowers_s_white_01_flower_001.020" />
                <radius>0</radius>
                <density>.5</density>
                <densityfactormap factor="1">fertile</densityfactormap>
            </geometry>
            <geometry>
                <factory maxdist="35" name="mushroom_or_001.004_mushroom_red_001mushroom_red_001_mushroom_red_001" />
                <radius>0.1</radius>
                <density>.01</density>
                <densityfactormap factor="0.15">fertile</densityfactormap>
            </geometry>
            <geometry>
                <factory maxdist="80" name="tree_generic_001.027_treebrown_002tree_generic_002_treebrown_002" />
                <radius>.4</radius>
                <density>.01</density>
                <densityfactormap factor="0.5">fertile</densityfactormap>
            </geometry>
            <geometry>
                <factory maxdist="30" name="rocks_01.075_rocks_rock_02rocks_02_Circle.001" />
                <radius>.15</radius>
                <density>.01</density>
                <densityfactormap factor="1">fertile</densityfactormap>
            </geometry>
            <alphascale mindist="22" maxdist="30" />
            <samplebox>
                <min x="0" y="-200" z="0" />
                <max x="512" y="300" z="512" />
            </samplebox>
            <meshobj>Terrain</meshobj>
            <numblocks>300</numblocks>
        </meshgen>

        <meshgen name="water_terrain_foliage">
            <densityfactormap name="watermap">
                <image>meshmaps/water_ground.png</image>
		<scale offsetx="0" offsety="0" w="1025" h="1025" />
            </densityfactormap>
            <geometry>
                <factory maxdist="40" name="Grass" />
                <radius>0</radius>
                <density>.45</density>
                <windbias>0.5</windbias>
                <winddirection x=".1" y=".1" />
                <windspeed>0.1</windspeed>
                <densityfactormap factor="1">watermap</densityfactormap>
            </geometry>
            <geometry>
                <factory maxdist="30" name="rocks_01.075_rocks_rock_02rocks_02_Circle.001" />
                <radius>.15</radius>
                <density>.075</density>
                <densityfactormap factor="1">watermap</densityfactormap>
            </geometry>
            <alphascale mindist="22" maxdist="30" />
            <samplebox>
                <min x="0" y="-200" z="0" />
                <max x="512" y="49.5" z="512" />
            </samplebox>
            <meshobj>Terrain</meshobj>
        </meshgen>

        <meshgen name="water_ground_foliage">
            <densityfactormap name="watermap">
                <image>meshmaps/water_ground.png</image>
		<scale offsetx="0" offsety="0" w="20000" h="20000" />
            </densityfactormap>
            <geometry>
                <factory maxdist="40" name="Grass" />
                <radius>0</radius>
                <density>.45</density>
                <windbias>0.5</windbias>
                <winddirection x=".1" y=".1" />
                <windspeed>0.1</windspeed>
                <densityfactormap factor="1">watermap</densityfactormap>
            </geometry>
            <geometry>
                <factory maxdist="30" name="rocks_01.075_rocks_rock_02rocks_02_Circle.001" />
                <radius>.15</radius>
                <density>.075</density>
                <densityfactormap factor="1">watermap</densityfactormap>
            </geometry>
            <alphascale mindist="22" maxdist="30" />
            <samplebox>
                <min x="-512" y="-200" z="-512" />
                <max x="1024" y="49.5" z="1024" />
            </samplebox>
            <meshobj>ground</meshobj>
        </meshgen>

    </sector>

</world>
