How to apply anti-aliasing only to specific objects?

For example
Scene : obj1,obj2.obj3;

I want : obj1 antialias =true effect;
obj2 antialias =false effect;
obj3 antialias =false effect;

What should I do? Thanks

There is not easy way to apply antialiasing to selected objects. Usually antialiasing is applied to the whole backbuffer or renderbuffer.

You might want to try an approach based on post-processing where you use a FXAA pass only for a certain group of objects. So you render these objects first, apply FXAA and then render other objects. This approach is not perfect since you might have problems with missing values in your depth buffer. More information about that topic right here:

1 Like

Geez Louise, how many reports does it take to get a post flagged here, one?

If this number is less than the number of moderators then the wording really shouldn’t be

“flagged by the community”.

@Mugen87’s answer is quite overkill, and does not consider the fact that OP is asking for an abstract / high level interface.

When using the effect composer, even while this effect is possible, the code involved (interfaces) are much different and removed from the scene graph.

myMesh.antialias = true //<--scene graph operation

//this is more than just scene graph operations:
processor.render(someGroup, camera, someBuffer)
processor.process(someBuffer, antialiasing

In which case this becomes quite a different question since antialiasing just one of infinitely many passes (a subset) you can apply in the effect composer.

My original answer addresses the direct ask and the example provided, no more no less.

The question from the topic is also

How to apply anti-aliasing only to specific objects.

which is different from how to apply it to “buffers”.

Thank you.