2
$\begingroup$

I have rendered images that I'm going to post-process. Some objects in the scene are supposed to act as markers that the post-processing script will try to locate based on the pixel value being pure black (ie argb: #ff000000).

I created a principal BSDF material with zero specular etc, and applied it to a small cube object, but when it's rendered, you can see the output pixels around the edges are of varying shades / opacities:

enter image description here

Is there any way to make a material that'll render pure black with zero opacity?

Thanks

$\endgroup$
2
  • $\begingroup$ Looks like your small cube is really small compared to the rendering resolution, so the contours will be anti-aliased. The center is pure black, though... $\endgroup$
    – eezacque
    Commented Sep 16, 2022 at 20:11
  • $\begingroup$ maybe an Emission instead of a Principled? $\endgroup$
    – moonboots
    Commented Sep 17, 2022 at 9:02

2 Answers 2

4
$\begingroup$

Use no shader at all. Empty socket on surface.

enter image description here

You could also use Cryptomatte to generate a pixel perfect mask if the anti-aliasing around the edges is troublesome.

enter image description here

enter image description here

You can clearly see the staircase here representing every pixel where the object could be sampled.

$\endgroup$
1
$\begingroup$

I would recommend trying a Diffuse shader instead of a Principled BSDF. A diffuse shader essentially adds 'pigment' to a material, without any kind of gloss, specularity, opacity, etc.

However judging by your screenshot I believe the grey variations you are getting are a result of anti-aliasing related to the resolution of your render (and the relative size of the black object), not the shader. The grey variations appear to be a blend of the pure black from your shader, and the grey background.

I would maybe try increasing the resolution of your render (try 200/400%?) and maybe turning off denoising to see if that improves matters.

enter image description here

enter image description here

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .