Because this would simply be cool....
Captured from render monkey...
Edit, forgot to mention to people who does not have much insight into shaders, that these lights come on as the planets surface come into the nightside of the planet...
if you download rendermonkey from AMD/ATI, and load the earth example.. you can see the effect...
Edit: addtional effects could be to make the planets surface somewhat dynamic... for instance gas gaints with moving clouds.. and so on... or wobbely surface... i wish i could show you an example of what i mean.. but like this..
Code: Select all
struct appdata
{
float4 position : POSITION;
float4 color : COLOR0;
float3 wave : COLOR1;
};
struct vfconn
{
float4 HPos : POSITION;
float4 Col0 : COLOR0;
};
vfconn main(appdata IN, uniform float4x4 ModelViewProj)
{
vfconn OUT; // Variable to handle our output from the vertex
// shader (goes to a fragment shader if available).
// Change The Y Position Of The Vertex Based On Sine Waves
IN.position.y = ( sin(IN.wave.x + (IN.position.x / 5.0) ) + sin(IN.wave.x + (IN.position.z / 4.0) ) ) * 2.5f;
// Transform The Vertex Position Into Homogenous Clip-Space (Required)
OUT.HPos = mul(ModelViewProj, IN.position);
// Set The Color To The Value Specified In IN.color
OUT.Col0.xyz = IN.color.xyz;
return OUT;
}