Game Development Reference
In-Depth Information
Device->SetSamplerState(StringTexDesc.RegisterIndex,
D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
Device->SetSamplerState(StringTexDesc.RegisterIndex,
D3DSAMP_MIPFILTER, D3DTEXF_LINEAR);
// draw the quad
Device->DrawPrimitive(D3DPT_TRIANGLELIST, 0, 2);
Device->EndScene();
Device->Present(0, 0, 0, 0);
}
return true;
}
Of course we must remember to free our allocated interfaces in the
Cleanup function:
void Cleanup()
{
d3d::Release<IDirect3DVertexBuffer9*>(QuadVB);
d3d::Release<IDirect3DTexture9*>(BaseTex);
d3d::Release<IDirect3DTexture9*>(SpotLightTex);
d3d::Release<IDirect3DTexture9*>(StringTex);
d3d::Release<IDirect3DPixelShader9*>(MultiTexPS);
d3d::Release<ID3DXConstantTable*>(MultiTexCT);
}
18.6 Summary
Pixel shaders replace the multitexturing stage of the fixed function
pipeline. Furthermore, pixel shaders give us the ability to modify
pixels on an individual basis in any way that we choose and access
texture data, thereby empowering us to implement many special
effects that could not be achieved in the fixed function pipeline.
Multitexturing is the process of enabling several textures at once
and blending them together to produce a desired result. Multi-
texturing is typically used to implement a complete lighting engine
for static geometry.
The HLSL intrinsic sampler objects identify a particular tex-
ture/sampler stage. A sampler object is used to refer to a tex-
ture/sampler stage from the pixel shader.
Search WWH ::




Custom Search