To do something to part of a render based on an ID mask, you need to first separate that part out. One way to do this is:
- Use the ID mask node to get a boolean mask of the part you want from the ID pass. When given the same index as the one you set in your material (in this case
3
), this node will give you mask where pixels on that material are 1
, and everything else is 0
.
- Use this mask to set the alpha channel of your image, with a Set Alpha node.
- Perform whatever operation you want (blur).
- Composite the result back over your first image, with an Alpha Over node.
That said,
If you are trying to create a bloom effect you may be better off separating by brightness alone. This works best if you make your scene with a realistic dynamic range (tl;dr: make lights bright and adjust the camera exposure).
If you have your lights set up with appropriate brightness, you can get pretty nice results with just the Glare node:
Regarding this comment:
Why can't we blur a material without Pass index? I mean, it's already a seperated and unique object. Why blur isn't just a material's property? Why I can't see the actual render in Render mode view? Thank you in advance, you've already helped me so much.
The compositor does post processing, that is, manipulations to the image after the render engine has rendered it. The compositor doesn't deal with 3D objects anymore, but rather flat arrays of pixels the render engine has spit out. So, if we want to do something to a very specific set of pixels, we need to have the render engine spit out a flat array of pixels telling us which pixels represent our material (a mask). Then we can have the compositor use that information to change some pixels to our liking.
Blur isn't a material property because materials describe how light interacts with a surface. A surface can't really be "blurry" in the sense you're looking for. In the case of bloom, in the real world the object's surface isn't blurred, rather, our view of it is what is blurred. So, blurring our "view" of the scene — the render engine's output — seems a reasonable way of implementing a similar effect.
It should be noted that "blur" is perhaps too simple a term to describe what is actually going on with what we call "glare" and "lens flare"; the phenomena involved can get quite complex.