Solar Wind 3D Sample

This sample for Silverilght 5 uses the new 3D features to draw the Earth with day and night transitions, atmosphere layers, and population density overlays. It demonstrates advanced concepts like mipmaps, texture blending, multiple drawing passes, sampler states...

C# (10.4 MB)
 
 
 
 
 
4.4 Star
(8)
9,128 times
Add to favorites
9/12/2011
E-mail Twitter del.icio.us Digg Facebook
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>8.0.50727</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{11348748-E3DA-4FFF-A721-29E984684877}</ProjectGuid>
    <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>SolarWind</RootNamespace>
    <AssemblyName>SolarWind</AssemblyName>
    <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
    <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
    <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
    <SilverlightApplication>true</SilverlightApplication>
    <SupportedCultures>
    </SupportedCultures>
    <XapOutputs>true</XapOutputs>
    <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
    <XapFilename>SolarWind.xap</XapFilename>
    <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
    <SilverlightAppEntry>SolarWind.App</SilverlightAppEntry>
    <TestPageFileName>SolarWindTestPage.html</TestPageFileName>
    <CreateTestPage>true</CreateTestPage>
    <ValidateXaml>true</ValidateXaml>
    <EnableOutOfBrowser>false</EnableOutOfBrowser>
    <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
    <UsePlatformExtensions>false</UsePlatformExtensions>
    <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
    <LinkedServerProject>
    </LinkedServerProject>
  </PropertyGroup>
  <!-- This property group is only here to support building this project using the 
       MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs 
       to set the TargetFrameworkVersion to v3.5 -->
  <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>Bin\Debug</OutputPath>
    <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
    <NoStdLib>true</NoStdLib>
    <NoConfig>true</NoConfig>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>Bin\Release</OutputPath>
    <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
    <NoStdLib>true</NoStdLib>
    <NoConfig>true</NoConfig>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Microsoft.Xna.Framework" />
    <Reference Include="Microsoft.Xna.Framework.Graphics" />
    <Reference Include="Microsoft.Xna.Framework.Graphics.Shaders" />
    <Reference Include="Microsoft.Xna.Framework.Math">
      <HintPath>.\Microsoft.Xna.Framework.Math.dll</HintPath>
    </Reference>
    <Reference Include="mscorlib" />
    <Reference Include="System.Windows" />
    <Reference Include="system" />
    <Reference Include="System.Core" />
    <Reference Include="System.Net" />
	<Reference Include="System.Windows.Xna" />
    <Reference Include="System.Xml" />
    <Reference Include="System.Windows.Browser" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="AboutDialog.xaml.cs">
      <DependentUpon>AboutDialog.xaml</DependentUpon>
    </Compile>
    <Compile Include="App.xaml.cs">
      <DependentUpon>App.xaml</DependentUpon>
    </Compile>
    <Compile Include="Camera.cs" />
    <Compile Include="ContentManager.cs" />
    <Compile Include="EarthAtmosphereLayer.cs" />
    <Compile Include="EarthPopulationLayer.cs" />
    <Compile Include="Earth.cs" />
    <Compile Include="Primitives3D\GeometricPrimitive.cs" />
    <Compile Include="Keyboard.cs" />
    <Compile Include="MagneticField.cs" />
    <Compile Include="MainPage.xaml.cs">
      <DependentUpon>MainPage.xaml</DependentUpon>
    </Compile>
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Compile Include="Scene.cs" />
    <Compile Include="Primitives3D\SpherePrimitive.cs" />
    <Compile Include="Primitives3D\TorusPrimitive.cs" />
    <Compile Include="Primitives3D\VertexPositionNormalTexture.cs" />
  </ItemGroup>
  <ItemGroup>
    <ApplicationDefinition Include="App.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </ApplicationDefinition>
    <Page Include="AboutDialog.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
    <Page Include="MainPage.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
  </ItemGroup>
  <ItemGroup>
    <PixelShader Include="Shaders\AtmosphereLower_ps.hlsl" />
    <None Include="Shaders\AtmosphereCommon_ps.hlsl" />
    <PixelShader Include="Shaders\Population_ps.hlsl" />
    <VertexShader Include="Shaders\MagneticField_vs.hlsl" />
    <PixelShader Include="Shaders\MagneticField_ps.hlsl" />
    <None Include="Shaders\EarthCommon.hlsl" />
    <None Include="Shaders\Noise.hlsl" />
    <PixelShader Include="Shaders\AtmosphereUpper_ps.hlsl" />
    <VertexShader Include="Shaders\AtmosphereUpper_vs.hlsl" />
    <VertexShader Include="Shaders\AtmosphereLower_vs.hlsl" />
    <None Include="Shaders\AtmosphereCommon_vs.hlsl" />
    <PixelShader Include="Shaders\Clouds_ps.hlsl" />
    <PixelShader Include="Shaders\Earth_ps.hlsl" />
    <VertexShader Include="Shaders\Earth_vs.hlsl" />
    <None Include="Properties\AppManifest.xml">
      <SubType>Designer</SubType>
    </None>
  </ItemGroup>
  <ItemGroup>
    <Resource Include="Textures\MagneticField\FieldLineRed.png" />
    <Resource Include="Textures\Earth\EarthClouds.png" />
    <Resource Include="Textures\Earth\EarthDay.png" />
    <Resource Include="Textures\Earth\EarthElevation.png" />
    <Resource Include="Textures\Earth\EarthMask.png" />
    <Resource Include="Textures\Earth\EarthNight.png" />
    <Resource Include="Textures\Earth\EarthNightLights.png" />
    <Resource Include="Textures\Earth\EarthNormal.png" />
  </ItemGroup>
  <ItemGroup>
    <Resource Include="Textures\Earth\EarthAtmosphere.png" />
  </ItemGroup>
  <ItemGroup>
    <Resource Include="Textures\Earth\EarthPopulation.png" />
  </ItemGroup>
  <ItemGroup>
    <Resource Include="Textures\Stars.jpg" />
  </ItemGroup>
  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
  <ItemGroup Condition="'$(BuildingInsideVisualStudio)'=='true'">
    <AvailableItemName Include="VertexShader">
      <Visible>false</Visible>
    </AvailableItemName>
    <AvailableItemName Include="PixelShader">
      <Visible>false</Visible>
    </AvailableItemName>
  </ItemGroup>
  <ItemGroup>
    <None Include="Shaders\EarthCommon_vs.hlsl" />
  </ItemGroup>
  <UsingTask TaskName="ShaderBuildTask.ShaderCompile" AssemblyName="ShaderBuildTask, Version=1.0.3072.18169, Culture=neutral, PublicKeyToken=44e467d1687af125" />
  <Target Name="VertexShaderCompile" Condition="'@(VertexShader)' != '' " BeforeTargets="Build">
    <ShaderCompile Sources="@(VertexShader)" ShaderProfile="vs_2_0" IntermediateOutputPath="$(IntermediateOutputPath)">
      <Output TaskParameter="Outputs" ItemName="Resource" />
    </ShaderCompile>
  </Target>
  <Target Name="PixelShaderCompile" Condition="'@(PixelShader)' != '' " BeforeTargets="Build">
    <ShaderCompile Sources="@(PixelShader)" ShaderProfile="ps_2_0" IntermediateOutputPath="$(IntermediateOutputPath)">
      <Output TaskParameter="Outputs" ItemName="Resource" />
    </ShaderCompile>
  </Target>
  <PropertyGroup>
    <!-- Add effect compilation to the PrepareResourcesDependsOn so that the effect fx  get compiled before resources are collected -->
    <PrepareResourcesDependsOn>VertexShaderCompile;PixelShaderCompile;$(PrepareResourcesDependsOn)</PrepareResourcesDependsOn>
  </PropertyGroup>
  <ProjectExtensions>
    <VisualStudio>
      <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
        <SilverlightProjectProperties />
      </FlavorProperties>
    </VisualStudio>
  </ProjectExtensions>
  <PropertyGroup>
    <!--<PreBuildEvent>fxc /O3 /T vs_2_0 /Zpr /Fo "$(ProjectDir)Shaders\EarthVS.vs" "$(ProjectDir)Shaders\EarthVS.fx"
fxc /O3 /T ps_2_0 /Zpr /Fo "$(ProjectDir)Shaders\EarthPS.ps" "$(ProjectDir)Shaders\EarthPS.fx"
fxc /O3 /T vs_2_0 /Zpr /Fo "$(ProjectDir)Shaders\AtmosphereVS.vs" "$(ProjectDir)Shaders\AtmosphereVS.fx"
fxc /O3 /T vs_2_0 /Zpr /Fo "$(ProjectDir)Shaders\AtmosphereUpperVS.vs" "$(ProjectDir)Shaders\AtmosphereUpperVS.fx"
fxc /O3 /T ps_2_0 /Zpr /Fo "$(ProjectDir)Shaders\CloudsPS.ps" "$(ProjectDir)Shaders\CloudsPS.fx"
fxc /O3 /T ps_2_0 /Zpr /Fo "$(ProjectDir)Shaders\AtmosphereLowerPS.ps" "$(ProjectDir)Shaders\AtmosphereLowerPS.fx"
fxc /O3 /T ps_2_0 /Zpr /Fo "$(ProjectDir)Shaders\AtmosphereUpperPS.ps" "$(ProjectDir)Shaders\AtmosphereUpperPS.fx"
fxc /O3 /T ps_2_0 /Zpr /Fo "$(ProjectDir)Shaders\MagneticFieldPS.ps" "$(ProjectDir)Shaders\MagneticFieldPS.fx"
fxc /O3 /T vs_2_0 /Zpr /Fo "$(ProjectDir)Shaders\MagneticFieldVS.vs" "$(ProjectDir)Shaders\MagneticFieldVS.fx"
fxc /O3 /T ps_2_0 /Zpr /Fo "$(ProjectDir)Shaders\PopulationPS.ps" "$(ProjectDir)Shaders\PopulationPS.fx"
fxc /O3 /T vs_2_0 /Zpr /Fo "$(ProjectDir)Shaders\PopulationVS.vs" "$(ProjectDir)Shaders\PopulationVS.fx"</PreBuildEvent>-->
  </PropertyGroup>
</Project>