CHAPTER 2 ■ SETTING UP DIFFERENT CAMERA MODES IN YOUR 3D WORLD
88
SkyBoxVertexToPixel SkyBoxVS( float4 inPos : POSITION)
{
SkyBoxVertexToPixel Output = (SkyBoxVertexToPixel)0;
float4x4 preViewProjection = mul (xView, xProjection);
float4x4 preWorldViewProjection = mul (xWorld, preViewProjection);
Output.Position = mul(inPos, preWorldViewProjection);
Output.Pos3D = inPos;
return Output;
}
struct SkyBoxPixelToFrame
{
float4 Color : COLOR0;
};
SkyBoxPixelToFrame SkyBoxPS(SkyBoxVertexToPixel PSIn)
{
SkyBoxPixelToFrame Output = (SkyBoxPixelToFrame)0;
Output.Color = texCUBE(CubeTextureSampler, PSIn.Pos3D);
return Output;
}
technique SkyBox
{
pass Pass0
{
VertexShader = compile vs_1_1 SkyBoxVS();
PixelShader = compile ps_1_1 SkyBoxPS();
}
}
2-9. Draw Only ...