vertex_program planet_vert glsl
{ source planet.vert }

fragment_program planet_frag glsl
{ source planet.frag }

vertex_program planet_atmosphere_vert glsl
{ source planet_atmosphere.vert }

fragment_program planet_atmosphere_frag glsl
{ source planet_atmosphere.frag }

vertex_program atmosphereless_planet_vert glsl
{ source atmosphereless_planet.vert }

fragment_program atmosphereless_planet_frag glsl
{ source atmosphereless_planet.frag }

vertex_program gas_giant_vert glsl
{ source gas_giant.vert }

fragment_program gas_giant_frag glsl
{ source gas_giant.frag }

vertex_program asteroid_vert glsl
{ source asteroid.vert }

fragment_program asteroid_frag glsl
{ source asteroid.frag }

material planet {
    technique {
        pass {
            vertex_program_ref planet_vert
            { param_named_auto light_pos light_position_object_space 0 }

            fragment_program_ref planet_frag {
                param_named day_texture int 0
                param_named night_texture int 1
                param_named cloud_gloss_texture int 2
                param_named cloud_color float4 1.0 1.0 1.0 1.0
            }

            texture_unit
            { texture Terran01Day.png }

            texture_unit
            { texture Terran01Night.png }

            texture_unit
            { texture Terran01CloudGloss.png }
        }
    }
}

material atmosphere {
    technique {
        pass {
            scene_blend alpha_blend
            depth_write off

            vertex_program_ref planet_atmosphere_vert {
                param_named_auto light_pos light_position_object_space 0
                param_named_auto camera_pos camera_position_object_space
            }

            fragment_program_ref planet_atmosphere_frag {
                param_named atmosphere_color float4 0.501 0.684 1.0 0.45
                param_named atmosphere_edge_color float4 0.501 0.684 1.0 0.65
            }
        }
    }
}

material atmosphereless_planet {
    technique {
        pass {
            vertex_program_ref atmosphereless_planet_vert
            { param_named_auto light_pos light_position_object_space 0 }

            fragment_program_ref atmosphereless_planet_frag {
                param_named day_texture int 0
                param_named night_texture int 1
                param_named normal_texture int 2
                param_named lights_texture int 3
                param_named lights_channel int -1
            }

            texture_unit
            { texture Barren01Day.png }

            texture_unit
            { texture Barren01Night.png }

            texture_unit
            { texture Barren01Normal.png }

            texture_unit
            { texture Barren01LightsA.png }
        }
    }
}

material gas_giant_core {
    technique {
        pass {
            lighting off
            colour_write off
        }
    }
}

material gas_giant {
    technique {
        pass {
            scene_blend alpha_blend
            depth_write off

            vertex_program_ref gas_giant_vert {
                param_named_auto light_pos light_position_object_space 0
                param_named_auto camera_pos camera_position_object_space
            }

            fragment_program_ref gas_giant_frag
            { param_named gas_texture int 0 }

            texture_unit
            { texture GasGiant01.png }
        }
    }
}

material asteroid {
    technique {
        pass {
            vertex_program_ref asteroid_vert
            { param_named_auto light_pos light_position_object_space 0 }

            fragment_program_ref asteroid_frag {
                param_named color_texture int 0
                param_named normal_texture int 1
            }

            texture_unit
            { texture Asteroid01Color.png }

            texture_unit
            { texture Asteroid01Normal.png }
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// planet materials
////////////////////////////////////////////////////////////////////////////////

material swamp_planet_01 : planet {
    technique {
        pass {
            fragment_program_ref planet_frag
            { param_named cloud_color float4 1.0 1.0 1.0 1.0 }
        }
    }
}

material toxic_planet_01 : planet {
    technique {
        pass {
            fragment_program_ref planet_frag
            { param_named cloud_color float4 1.0 1.0 1.0 1.0 }
        }
    }
}

material inferno_planet_01 : planet {
    technique {
        pass {
            fragment_program_ref planet_frag
            { param_named cloud_color float4 0 0 0 1.0 }
        }
    }
}

material tundra_planet_01 : planet {
    technique {
        pass {
            fragment_program_ref planet_frag
            { param_named cloud_color float4 1.0 1.0 1.0 1.0 }
        }
    }
}

material desert_planet_01 : planet {
    technique {
        pass {
            fragment_program_ref planet_frag
            { param_named cloud_color float4 1.0 1.0 1.0 1.0 }
        }
    }
}

material terran_planet_01 : planet {
    technique {
        pass {
            fragment_program_ref planet_frag
            { param_named cloud_color float4 1.0 1.0 1.0 1.0 }
        }
    }
}

material ocean_planet_01 : planet {
    technique {
        pass {
            fragment_program_ref planet_frag
            { param_named cloud_color float4 1.0 1.0 1.0 1.0 }
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// atmosphere materials
////////////////////////////////////////////////////////////////////////////////

material swamp_atmosphere_01 : atmosphere {
    technique {
        pass {
            fragment_program_ref planet_atmosphere_frag {
                param_named atmosphere_color float4 0.201 0.884 0.7 0.45
                param_named atmosphere_edge_color float4 0.201 0.984 0.7 0.65
            }
        }
    }
}

material toxic_atmosphere_01 : atmosphere {
    technique {
        pass {
            fragment_program_ref planet_atmosphere_frag {
                param_named atmosphere_color float4 1 0.8 0.1 0.6
                param_named atmosphere_edge_color float4 1 0.7 0.1 0.9
            }
        }
    }
}

material inferno_atmosphere_01 : atmosphere {
    technique {
        pass {
            fragment_program_ref planet_atmosphere_frag {
                param_named atmosphere_color float4 0.95 0.20 0.1 0.7
                param_named atmosphere_edge_color float4 1 0.2 0.2 1
            }
        }
    }
}

material tundra_atmosphere_01 : atmosphere {
    technique {
        pass {
            fragment_program_ref planet_atmosphere_frag {
                param_named atmosphere_color float4 0.501 0.684 1.0 0.45
                param_named atmosphere_edge_color float4 0.501 0.684 1.0 0.65
            }
        }
    }
}

material desert_atmosphere_01 : atmosphere {
    technique {
        pass {
            fragment_program_ref planet_atmosphere_frag {
                param_named atmosphere_color float4 0.15 0.48 0.79 0.65
                param_named atmosphere_edge_color float4 0.25 0.58 0.89 0.5
            }
        }
    }
}

material terran_atmosphere_01 : atmosphere {
    technique {
        pass {
            fragment_program_ref planet_atmosphere_frag {
                param_named atmosphere_color float4 0.501 0.684 1.0 0.55
                param_named atmosphere_edge_color float4 0.601 0.784 1.0 1.0
            }
        }
    }
}

material ocean_atmosphere_01 : atmosphere {
    technique {
        pass {
            fragment_program_ref planet_atmosphere_frag {
                param_named atmosphere_color float4 0.551 0.684 1.0 0.45
                param_named atmosphere_edge_color float4 0.701 0.684 1.0 0.65
            }
        }
    }
}
