Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] Feature Requests => Topic started by: Jpjapers on 2019-04-16, 00:22:21

Title: Opacity map with depth?
Post by: Jpjapers on 2019-04-16, 00:22:21
Just curious. Would it be possible to implement a texture whereby the opacity map 'cutouts' can also have depth and enable a solid core to be shown?
e.g. holes drilled in veneered wood reveal the fiberboard core underneath to a user defined depth with the option of end capping?

It would mean that the geometry can stay very simple for objects that may have alot of cutouts and holes whilst being able to show some depth to the hole defined by the opacity map.
.
Title: Re: Opacity map with depth?
Post by: Njen on 2019-04-16, 01:41:52
I imagine this would be possible with the OSL Parallax shader, where you could make tiny little window boxes around each hole (A cube is much more lightweight than a cylinder). Though the only thing I'm not sure about is how it would play with being rendered in Corona.
Maya example, but the technique would be same for the Max version: http://julius-ihle.de/?p=2451
Title: Re: Opacity map with depth?
Post by: Jpjapers on 2019-04-16, 10:29:45
I imagine this would be possible with the OSL Parallax shader, where you could make tiny little window boxes around each hole (A cube is much more lightweight than a cylinder). Though the only thing I'm not sure about is how it would play with being rendered in Corona.
Maya example, but the technique would be same for the Max version: http://julius-ihle.de/?p=2451

As far as i remember OSL isnt supported yet or has that changed in dailies?
Title: Re: Opacity map with depth?
Post by: romullus on 2019-04-16, 11:02:55
Duplicate: https://forum.corona-renderer.com/index.php?topic=15639.0
Title: Re: Opacity map with depth?
Post by: romullus on 2019-04-16, 11:16:30
By the way, this is already possible in Corona to some extent. With Corona distance you can get render-time booleans with pretty spectacular results. It's not very easy to setup and probably not aplicable to every scenario, but still..
Title: Re: Opacity map with depth?
Post by: Jpjapers on 2019-04-16, 12:19:59
By the way, this is already possible in Corona to some extent. With Corona distance you can get render-time booleans with pretty spectacular results. It's not very easy to setup and probably not aplicable to every scenario, but still..

Interesting, how is the plywood material appled inside the cutouts? Could you show a material graph?
Title: Re: Opacity map with depth?
Post by: romullus on 2019-04-16, 12:33:00
I'm attaching scene, so you can inspect it by yourself.
Title: Re: Opacity map with depth?
Post by: Jpjapers on 2019-04-16, 12:34:18
I'm attaching scene, so you can inspect it by yourself.

perfect thank you :)
Title: Re: Opacity map with depth?
Post by: jrgby on 2019-04-16, 13:35:25
I'm attaching scene, so you can inspect it by yourself.
Clever... and confusing! Thanks for sharing.
Title: Re: Opacity map with depth?
Post by: romullus on 2019-04-16, 14:33:27
I'm not claiming authorship of that idea, it was already shown by someone in the forum, as soon as distance map came around. I agree that it's a bit tricky to setup and maintain this thing, that's why we are all waiting for Corona slicer :]
Title: Re: Opacity map with depth?
Post by: Jpjapers on 2019-04-16, 14:54:36
I'm not claiming authorship of that idea, it was already shown by someone in the forum, as soon as distance map came around. I agree that it's a bit tricky to setup and maintain this thing, that's why we are all waiting for Corona slicer :]

Yeah i think it was Maru posted something similar after doing some digging.
Corona clipper object would be awesome. Hopefully its coming seeing I put a request in 5 years ago.
Title: Re: Opacity map with depth?
Post by: bluebox on 2019-04-16, 15:56:12
I originally linked to the description of the method, then Maru made a tutorial based on that idea https://forum.corona-renderer.com/index.php?topic=8665.msg80853#msg80853

This way of doing render time booleans is super cumbersome to setup and slow to render. That is why everyone is requesting easier to setup slicer which is postponed for years now.
Title: Re: Opacity map with depth?
Post by: Jpjapers on 2019-04-17, 01:19:54
I originally linked to the description of the method, then Maru made a tutorial based on that idea https://forum.corona-renderer.com/index.php?topic=8665.msg80853#msg80853

This way of doing render time booleans is super cumbersome to setup and slow to render. That is why everyone is requesting easier to setup slicer which is postponed for years now.
Ah thats a shame i didnt think it would affect render time that badly.
Title: Re: Opacity map with depth?
Post by: Jpjapers on 2019-04-26, 14:49:14
So i tried this as per maru's tutorial and it didnt work
Ive attached my setup and the result.
It appears to be capping the boolean at a very small depth?
Title: Re: Opacity map with depth?
Post by: romullus on 2019-04-26, 15:07:17
It's probably would be best to attach scene for inspection. Most likely you did some mistake here, as i see no reason for such setup not to work.
Title: Re: Opacity map with depth?
Post by: Jpjapers on 2019-04-26, 15:48:09
It's probably would be best to attach scene for inspection. Most likely you did some mistake here, as i see no reason for such setup not to work.

Its the translucency applied to the acrylic material. I removed it and it worked fine. There are various major artefacts when using anything more complex than basic primitives however.
Ive noticed you get a really thin slice of the base object material before it changes to the inside edges. Is there a way to control the thickness of that edge?
Title: Re: Opacity map with depth?
Post by: romullus on 2019-04-26, 19:45:02
There are various major artefacts when using anything more complex than basic primitives however.

Distance map is known to produce artifacts in some cases. If your cutter has sharp angles, you can try to add tiny amount of chamfer and see if that helps. Also try to subdivide intersecting objects - that might help also.

Ive noticed you get a really thin slice of the base object material before it changes to the inside edges. Is there a way to control the thickness of that edge?

Are you using round corners on that material? Try to remove it and see if thin line disappears.