Hoping the more technical-minded here can help me out with a really strange issue I’m having. If this isn’t corona related then maybe I’ll take it straight to Autodesk, haha. I haven’t cross-tested in V-Ray.
ANYHOW
While doing product render tests, I’ve noticed that using an image for the mask of a layered or mix material gives an incorrect stroke appearance or halo of sorts around the text. I’ve tested this every way I know how - Using a white/black jpg, tiff, png, inverting the white/black jpg, tiff, png, testing all the different filtering methods, blur settings, as well as gamma changes, corona bitmap, max standard bitmap, corona layered material and standard mix material. Each time, same result.
HERE’S THE KICKER!
When its a white background (bottle) and black text, the sharpness reads perfectly, just as in the real photo. Both of those examples are attached here…
Anyone have any thoughts as to what this could be, or has anyone run into a similar issue in the past??
Hard to say without seeing an example input image. Thoughts
Any Blur used in the Filtering section of the Bitmap?
You mention this happening used as a mask for layer / mix materials, what happens if you just use it directly on a single material e.g. as Diffuse (and other inputs)? That would show if this is something to do with masking, or just something to do with the way the Bitmap nodes are handling it
Any blur or sharpen or other post effects used in the VFB?
Is the bitmap of a high enough resolution?
Any Denoising used?
Anything changed from the defaults in the Image Filter section of the System tab of the Render Settings?
On tests here, I can’t see any difference between using it as a mask or using it directly as a Diffuse material (not doing reflection or anything, just black and white color) - for me, I am not seeing a problem, the only thing showing is the anti-aliasing expected in the image (which can be affected by Exposure and Highlight Compress values as to just how strong that anti-aliasing shows up). I also couldn’t see any difference with white on black or black on white (I had both in the same image, a 4K PNG, attaching that here).
A few more tests here. It seems changing the image filter works in favor a bit, however does introduce unwanted aliasing on some edges of the product itself. The tests done are standard (Tent 2px), Sharper (Tent 1.5px) and Sharpest (Blackman-Harris 1px). Blackman absolutely worked the best for text, but introduced the most jagged aliasing on other geo. NOW what’s more interesting about all this is if I undo the “invert” on the alpha mask to bring it back to its original white background, black text, the text is the most sharp and delicate even while using the standard Tent @ 2px…
The final test is the bottle with a corona bitmap as the base material, and not a layered alpha. This still seems to keep the text a bit “bulky”
Can the image file being used not be sent via the private uploader? (or even the entire scene, since it would be private and only we would see it for testing purposes)
While testing whether the “Invert” option had any bearing on the issue, it gave me an interesting way to do an A/B comparison. White text on black is more likely to “grow” depending mostly on Exposure but also partly on Highlight Compress, while black text on white does not (or maybe black on white is more likely to shrink… not sure!)
Here are three images with different values were used in Exposure and Highlight Compress. Note that these were done with pure white which has is too high in albedo, but correcting for that did not seem to change that this takes place.
PS inverting isn’t the cause, as in the lower half of my image where there is reversed text on background colors, it is still the white text on black that “grows”
EDIT - attaching an image, with an even more extreme Highlight compress value change too; still the white text that “grows” even though it is now the “Not inverted” version
And as a last note, doesn’t matter whether the bitmap is used as Diffuse, or as a mask on a Layered. Whether anything is wrong here I can’t say, but it seems to come down to the Exposure and Highlight compress as the cause (without seeing the scene itself to confirm).
Wow thanks for all the replies and tests! I think I see what you’re getting at, and I had the same experience - Whether the diffuse slot is a white text on black bitmap OR it’s a layered material with an alpha (inverted or not), the result is the same.
The highlight compression is an interesting note - not sure if there’s a definitive reason, but my highlight compression typically around 5-10 depending on the scene, so this isn’t floating around the 0-1-2’s like you tested. I’d assume the “growing” effect of the white on black gets worse the lower the compression value.
I can privately send you a pared down scene to test, for sure. New to the forums though so let me know the best way to do that.
Stripped down to just the parts that show the issue is definitely preferred if you can, makes it easier to work with, smaller to upload, and means you are sharing less
It will completely prevent this effect, and will also disable AA for you.
So I guess it means that this is how AA works in Corona, and this is how it is supposed to work. I do not think it makes sense to turn this thread into a report in our tracking system, so I will just leave it here, and hopefully someone from our dev team will check it at some point, and provide technical explanation, since this is what we are all interested in.
I am also curious if this effect also happens in other renderers, and if so, then how it looks compared with Corona.
Thanks maru for your help. This does seem like a workaround as disabling AA won’t be great for many other edges and details in the image. Hopefully a technical explanation will come along too! I don’t have a Vray license unfortunately so I can’t test in another platform, but it would be interesting.
You can see the edges of the letters as tiny black-to-white or white-to-black gradients, right?
And we all know what gamma 2,2 does to gradients, right?
Here are some example images to confirm that.
2.2 images were saved “just like that” from 3ds Max with gamma 2.2 - that’s what you get when rendering with 3ds Max and Corona by default.
1.0 images were saved with gamma overridden from 2.2 to 1.0, which as you can see results in a linear gradient. So the tiny gradients in the letters are linear too.
As you can clearly see, with 2.2 the white-on-black text is thicker.
As you can also clearly see, with 1.0 the letters are the same. Some monitor profiles or optical illusions may be at play here, but if you take a look at the thin lines in “h” or “w”, you will definitely see it.
Extra: why did disabling anti-aliasing completely produce similar results? Because then we basically removed the tiny gradients on the edges of the letters.