Is it possible to apply a shader to a single object?

Is it possible to apply a shader to a single object in my scene? All the example shaders i've seen apply to every object in the scene…

Shaders are a renderstate, attach it directly to the object you want it and dont forget to update them.

Thank you, based on that, I thought of it like a render pass and it made more sense… Basically, I was cloning one of the shader tests and 3/4 of them do a render pass by rendering to a screen-sized quad… Which isnt good when you overlay it over a scene of other objects, because the image is screen-sized and non-clipped… So what I did in my shaderpass's doRender method was set up the shader and:



for (Spatial s: spatials){

s.setRenderState(shader);

s.updateRenderState();

s.draw®;

}



And then the code where I applied a different shader to different objects worked, rather than blanking out the other objects. I realise that various aspects of the other shaders, such as blur and outline wont work if you dont apply the shader to a full-screen node, since you will be rendering outside the object.