CHAPTER 3 ■ WORKING WITH 2D IMAGES/TEXTURES IN XNA 3.0
246
And of course here is the definition of the technique:
technique CylBillboard
{
pass Pass0
{
VertexShader = compile vs_1_1 CylBillboardVS();
PixelShader = compile ps_1_1 BillboardPS();
}
}
That will be all for the moment. All you need to do is import this HLSL file (which I called
bbEffect.fx) into your project and load it into a variable in your LoadContent method:
bbEffect = content.Load<Effect>("bbEffect");
Now in your Draw method, you can set the required XNA-to-HLSL variables and finally
render the billboards!
bbEffect.CurrentTechnique = bbEffect.Techniques["CylBillboard"];
bbEffect.Parameters["xWorld"].SetValue(Matrix.Identity);
bbEffect.Parameters["xProjection"].SetValue(quatMousCam.ProjectionMatrix); ...