Ok, I want to have to methods for shaders to work. First, to individual sprites, second to the whole scene(post processing effects). I've never used DirectX, SlimDX or shaders for that matter and I want to know if my idea of the implementation is correct along with a question at the end.
For a sprite:
Begin scene
if object has a shader
effect.begin
render object
effect.end
else
render object
render objects w/o shaders
end scene
For the whole scene:
Begin scene
if doing post processing effect
setRenderTarget(newSurface)
effect.begin
render scene
effect.end
render new surface to the buffer
end if
render scene normally
end scene
My question is, after I render the scene to the new surface to apply the shader, how do I render the surface to the main buffer? Simply draw a quad, with the surface applied as the texture?
EDIT: I just saw in the DirectX 9 docs that the setRenderTarget sets the viewport to the surface.
[Edited by - Eeyore on July 14, 2008 10:50:49 PM]