public void RenderQuadGreyScaleTexture3DOnly( DeviceContext deviceContext, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4, Vector3 t1, Vector3 t2, Vector3 t3, Vector3 t4, ShaderResourceView texture, Camera camera )
{
DataBox databox;
databox = deviceContext.MapSubresource( mPositionVertexBuffer,
0,
QUAD_NUM_VERTICES *
POSITION_NUM_COMPONENTS_PER_VERTEX *
POSITION_NUM_BYTES_PER_COMPONENT,
MapMode.WriteDiscard,
SlimDX.Direct3D11.MapFlags.None );
databox.Data.Write( p1 );
databox.Data.Write( p4 );
databox.Data.Write( p2 );
databox.Data.Write( p3 );
deviceContext.UnmapSubresource( mPositionVertexBuffer, 0 );
databox = deviceContext.MapSubresource( mTexCoordVertexBuffer,
0,
QUAD_NUM_VERTICES *
TEXCOORD_NUM_COMPONENTS_PER_VERTEX *
TEXCOORD_NUM_BYTES_PER_COMPONENT,
MapMode.WriteDiscard,
SlimDX.Direct3D11.MapFlags.None );
databox.Data.Write( t1 );
databox.Data.Write( t4 );
databox.Data.Write( t2 );
databox.Data.Write( t3 );
deviceContext.UnmapSubresource( mTexCoordVertexBuffer, 0 );
deviceContext.InputAssembler.InputLayout = mRenderGreyScaleTexture3DInputLayout;
deviceContext.InputAssembler.PrimitiveTopology = PrimitiveTopology.TriangleStrip;
deviceContext.InputAssembler.SetVertexBuffers( POSITION_SLOT,
new VertexBufferBinding( mPositionVertexBuffer,
POSITION_NUM_COMPONENTS_PER_VERTEX *
POSITION_NUM_BYTES_PER_COMPONENT,
0 ) );
deviceContext.InputAssembler.SetVertexBuffers( TEXCOORD_SLOT,
new VertexBufferBinding( mTexCoordVertexBuffer,
TEXCOORD_NUM_COMPONENTS_PER_VERTEX *
TEXCOORD_NUM_BYTES_PER_COMPONENT,
0 ) );
mEffect.GetVariableByName( "gTexture3D" ).AsResource().SetResource( texture );
mEffect.GetVariableByName( "gTransform" ).AsMatrix().SetMatrix( camera.GetLookAtMatrix() * camera.GetProjectionMatrix() );
mRenderGreyScaleTexture3DPass.Apply( deviceContext );
deviceContext.Draw( QUAD_NUM_VERTICES, 0 );
}