surface fancy( )
{
    FB = environment("flowers.rgb");
    FB *= color(.5,.2,.0,0);
    FB = under(texture("marblebirds.rgba",
                       scale(2.,2.,2.)));
}


shader_name "default"
shader_major_rev 1
shader_minor_rev 0
shader_locals

  texture_def
    texture_id $tex000 texture_src FILE texture_fmt RGBA
    texture_file "flowers.rgb.tif"

  texture_def
    texture_id $tex001 texture_src FILE texture_fmt RGBA
    texture_file "marblebirds.rgba.tif"

shader_default_state

shader_passes

  geom_pass

    colormask
        colormask_data 0xf

    stencil
        stencil_test_func ALWAYS stencil_ref 0x1 stencil_mask 0xff
        stencil_sfail KEEP stencil_zfail KEEP stencil_zpass REPLACE
        stencil_wmask 0xff

    depth
        depth_test_func LEQUAL depth_mask 0xff

    texture
        texture_id $tex000

    texgen
        texgen_coord S
        texgen_mode SPHERE_MAP

    texgen
        texgen_coord T
        texgen_mode SPHERE_MAP

  geom_pass

    colormask
        colormask_data 0xf

    stencil
        stencil_test_func LEQUAL stencil_ref 0x1 stencil_mask 0xff
        stencil_sfail KEEP stencil_zfail KEEP stencil_zpass KEEP
        stencil_wmask 0x7fffffff

    blend
        blend_eqn FUNC_ADD_EXT blend_src DST_COLOR blend_dst ZERO

    depth
        depth_test_func LEQUAL depth_mask 0xff

    color
        color_data (0.500000 0.200000 0.000000 0.000000)

  geom_pass

    colormask
        colormask_data 0xf

    stencil
        stencil_test_func LEQUAL stencil_ref 0x1 stencil_mask 0xff
        stencil_sfail KEEP stencil_zfail KEEP stencil_zpass KEEP
        stencil_wmask 0x7fffffff

    blend
        blend_eqn FUNC_ADD_EXT blend_src SRC_ALPHA blend_dst ONE_MINUS_SRC_ALPHA

    depth
        depth_test_func LEQUAL depth_mask 0xff

    texture
        texture_id $tex001

    matrix
        matrix_mode TEXTURE
        matrix_data (2.000000 0.000000 0.000000 0.000000)
                    (0.000000 2.000000 0.000000 0.000000)
                    (0.000000 0.000000 2.000000 0.000000)
                    (0.000000 0.000000 0.000000 1.000000)