Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] Bug Reporting => [Max] Resolved Bugs => Topic started by: alexyork on 2017-09-06, 11:33:05

Title: 8-bit Gradient Bitmaps result in noisy/lumpy renders
Post by: alexyork on 2017-09-06, 11:33:05
Found this today - if you have a simple black>white gradient map saved as an 8-bit file (PNG, TIFF, whatever) and load it into a bump slot, the result in the render will be super bumpy/lumpy at a small scale. If you produce this same map in 16-bit, this goes away and you get a perfectly smooth result, as you'd expect. Looks like Corona isn't happy sampling from an 8-bit gradient, basically.
Title: Re: 8-bit Gradient Bitmaps result in noisy/lumpy renders
Post by: maru on 2017-09-06, 13:14:30
Hi Alex, this is expected, as the 8-bit file simply carries less information in it, so what you will see are the actual "steps" between each color value of the gradient. A 16- or 32-bit file will have much more information in it, allowing for more smooth gradients to be rendered - be it diffuse color, bump, displacement, or anything else.

I am moving this to resolved bugs, but if you think this might be something different, please send us images of what exactly is happening.
Title: Re: 8-bit Gradient Bitmaps result in noisy/lumpy renders
Post by: alexyork on 2017-09-06, 13:24:23
Hey Maru,

Yeh, I don't think this isn't the usual 8-bit banding thing that's common with 8-bit gradients. It's a tiny, noisy "lumpy" result - I would expect to see banding if that was the case. I'll try to get you an image in a bit. It might be the same issue, though.
Title: Re: 8-bit Gradient Bitmaps result in noisy/lumpy renders
Post by: Ondra on 2017-09-06, 16:22:05
image would surely help ;)

"lumpy" could also mean jpeg artifacts or dithering...
Title: Re: 8-bit Gradient Bitmaps result in noisy/lumpy renders
Post by: alexyork on 2017-09-06, 16:42:38
Ok here we go. Please ignore the slight difference in the actual mapping, since that is caused by a slight difference between the two bitmaps. They are essentially the same, except one is 8-bit (PNG) and one is 16-bit (TIF).

With the map being used in the Diffuse slot of the material - there does seem to be some minor difference in the noise pattern although this might be cause i didn't set both to render the same no. passes each, so maybe just ignore that:

(http://i.imgur.com/kgodNfL.jpg)
8-bit

(http://i.imgur.com/N0gJRsz.jpg)
16-bit

With the map being used in the Bump slot of the material - well...

(http://i.imgur.com/p28xH4S.jpg)
8-bit

(http://i.imgur.com/6NiZSvy.jpg)
16-bit

Again please ignore noise levels and the mapping, which are unrelated. Filtering, blur and everything else is identical. Just the map was swapped out.

Cheers.
Title: Re: 8-bit Gradient Bitmaps result in noisy/lumpy renders
Post by: alexyork on 2017-09-06, 16:50:29
I have also used the Private Uploader to upload the source 8-bit PNG so you can check it out. It's definitely not 100% smooth looking especially in the darker parts of the gradients, but I wouldn't expect the bump mapping to look like this, personally.
Title: Re: 8-bit Gradient Bitmaps result in noisy/lumpy renders
Post by: pokoy on 2017-09-06, 17:34:40
Can you check with a 8 bit TIF? That one is really weird, I haven't seen this yet.
Title: Re: 8-bit Gradient Bitmaps result in noisy/lumpy renders
Post by: alexyork on 2017-09-06, 17:44:13
Will try to convert down from the original 16-bit to an 8-bit tiff and upload.
Title: Re: 8-bit Gradient Bitmaps result in noisy/lumpy renders
Post by: alexyork on 2017-09-06, 18:23:26
Well the result is exactly the same when I convert the correctly working 16-bit TIFF down to an 8-bit TIFF - lumpy bumpy result.
Title: Re: 8-bit Gradient Bitmaps result in noisy/lumpy renders
Post by: romullus on 2017-09-06, 18:51:21
Curious what would happen if you'd convert that 8 bit bitmap back to 16 bit. Would it stay bumpy lumpy or would it work as it should?
Title: Re: 8-bit Gradient Bitmaps result in noisy/lumpy renders
Post by: pokoy on 2017-09-06, 19:21:12
Weird - are you using CoronaBitmap for this by any chance? If yes, does normal Bitmap work OK?
Title: Re: 8-bit Gradient Bitmaps result in noisy/lumpy renders
Post by: Juraj on 2017-09-06, 20:30:56
Weird - are you using CoronaBitmap for this by any chance? If yes, does normal Bitmap work OK?

Yup, interested in this too. Just reported one bug today where CoronaBitmap loader created visual artifacts where normal bitmap would not.
Title: Re: 8-bit Gradient Bitmaps result in noisy/lumpy renders
Post by: alexyork on 2017-09-07, 10:15:10
Will try to test this in a min. Curious myself...
Title: Re: 8-bit Gradient Bitmaps result in noisy/lumpy renders
Post by: alexyork on 2017-09-07, 10:28:07
Converting to max bitmap instead of Corona bitmap makes no difference. Still lumpy.

And converting that 8-bit TIFF up to a (faked) 16-bit TIFF makes no difference either. Still lumpy.
Title: Re: 8-bit Gradient Bitmaps result in noisy/lumpy renders
Post by: romullus on 2017-09-07, 10:35:52
And converting that 8-bit TIFF up to a (faked) 16-bit TIFF makes no difference either. Still lumpy.

Well, at least that prooves that difference is in the file itself, not only in the way Corona treats it. Now the last step would be to try to render those two files in other renderer and see what its outcome would be :]
Title: Re: 8-bit Gradient Bitmaps result in noisy/lumpy renders
Post by: alexyork on 2017-09-07, 10:42:18
And converting that 8-bit TIFF up to a (faked) 16-bit TIFF makes no difference either. Still lumpy.

Well, at least that prooves that difference is in the file itself, not only in the way Corona treats it. Now the last step would be to try to render those two files in other renderer and see what its outcome would be :]

Hah.. .well, apart from Scanline we don't have anything else here. I've sent the map to the corona guys so perhaps they can take a look at it.
Title: Re: 8-bit Gradient Bitmaps result in noisy/lumpy renders
Post by: maru on 2017-09-11, 10:32:42
Moving back to bug reporting. We will look into this.
Title: Re: 8-bit Gradient Bitmaps result in noisy/lumpy renders
Post by: martinsik on 2017-09-19, 15:53:20
Update from dev team side: We have tested the uploaded 8 bit texture in different renderers in bump slot and it gives the same "stair case" look, no lumps are visible.
The lumps may be the result of the additional nodes that are used on top of the texture.
Title: Re: 8-bit Gradient Bitmaps result in noisy/lumpy renders
Post by: alexyork on 2017-09-19, 16:06:53
Cheers. I'll see at some point if I can figure out if that's the case.
Title: Re: 8-bit Gradient Bitmaps result in noisy/lumpy renders
Post by: Ondra on 2017-09-22, 15:30:41
ok, moving to resolved unless the bug is isolated