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
//
// This file is a pixel shader for drawing magnetic fields
//

sampler2D GradientSampler : register(s0);

// Structs

// application vertex buffer
struct Vertex 
{
    float3 Position     : POSITION;
    float3 Normal       : NORMAL;
    float2 UV		    : TEXCOORD0;
};

// define outputs from vertex shader
struct VertexShaderData
{
    float4 Position		: POSITION;
    float4 Color		: COLOR;
};

// Pixel Shader
float4 main(VertexShaderData input) : COLOR 
{
	float2 uv = float2(input.Color.x, 0.5);
	return float4(tex2D(GradientSampler, uv).rgb, 0.8);
}