Game Development Reference
In-Depth Information
[maxvertexcount(3)]
void GSMAIN( triangle VS_OUTPUT input[3],
inout TriangleStream <VS_OUTPUT> OutputStream )
{
float minHeight = min( input[0].height, input[1].height );
minHeight = min( minHeight, input[2].height );
float maxLength =
max( length( abs(input[0].height - input[1].height) ),
length( abs(input[1].height - input[2].height) ) );
maxLength =
max( maxLenth,
length( abs(input[2].height - input[0].height) ) );
if (( minHeight > 0.1f ) && ( maxLength < 0.075f )) {
for ( int i=0;i<3;i++){
OutputStream.Append(input[i]);
}
}
OutputStream.RestartStrip();
}
Listing 2.5. The geometry shader for expelling elongated triangles.
float4 PSMAIN( in VS_OUTPUT input ) : SV_Target
{
float4 vValues = KinectColorBuffer.Sample(
LinearSampler , input.colorOffset );
return ( vValues );
}
Listing 2.6. The pixel shader for sampling the color frame data.
Figure 2.9. The final output from the sample application.
 
 
Search Nedrilad ::




Custom Search