Chaos Corona Forum

Chaos Corona for Cinema 4D => [C4D] I need help! => Topic started by: Pepelecrabb on 2022-04-17, 19:04:37

Title: Decal on thick glass
Post by: Pepelecrabb on 2022-04-17, 19:04:37
Is it possible to use a Decal on glass with thickness (such as a bottle) without it being seen on the back polygons? Also, is it possible to to have a  back material to the Decal?
It all seems possible with a flat plane of glass but when the glass is curved so much that the Decal depth has to be increased enough to encapsulate the curve it also gets projected onto the back of the glass, and also using 2 different materials for the front and back projection no longer work correctly.
I've fiddled with different projections with the decal materials. Different glass materials. And different lighting. It would be so nice to get this to work instead of going back to the old method of splitting out polygons to make a label.
Title: Re: Decal on thick glass
Post by: romullus on 2022-04-17, 19:18:59
Adjust max angle limit until decal stops projecting on back wall.
Title: Re: Decal on thick glass
Post by: Pepelecrabb on 2022-04-17, 20:07:24
Thanks for your speedy response...but max angle limit does not help, or at least not enough, on something such as a glass bottle .
Title: Re: Decal on thick glass
Post by: BigAl3D on 2022-04-18, 15:23:30
Could it be the decal is casting a shadow? Well that what it looks like anyway.
Title: Re: Decal on thick glass
Post by: romullus on 2022-04-18, 16:04:28
Thanks for your speedy response...but max angle limit does not help, or at least not enough, on something such as a glass bottle .

Hmm, works fine here. Can you specify what's the issue exactly?

Title: Re: Decal on thick glass
Post by: Beanzvision on 2022-04-19, 13:08:33
The Max angle will and does work here. The problem is that even after doing so, there is still a ''double'' projected decal on the backside of the glass when viewed from the front. Visible in both Max (yours) and my image. Looks like a bug to me ;)

(https://forum.corona-renderer.com/index.php?action=dlattach;topic=36162.0;attach=164345;image)

(Internal ID=882775906)
Title: Re: Decal on thick glass
Post by: Pepelecrabb on 2022-04-19, 13:46:53
Don't think it is a bug, just the limit of usefulness at this point. It's not a reflection or a shadow. You cannot encapsulate the outside of curved glass with the decal and and not have it include the inside. The angle of the inside and outside of the glass are too similar and close for the Max Angle Limit to work.  If I could perhaps include/exclude a polygon selection.
Title: Re: Decal on thick glass
Post by: romullus on 2022-04-19, 15:06:58
The Max angle will and does work here. The problem is that even after doing so, there is still a ''double'' projected decal on the backside of the glass when viewed from the front. Visible in both Max (yours) and my image. Looks like a bug to me ;)

(Internal ID=882775906)

Ah yes, you're right, but there is sollution still - one can use Corona front/back texmap in opacity, where front slot would have original opacity map assigned to it and back slot would be completely black.
Title: Re: Decal on thick glass
Post by: Beanzvision on 2022-04-19, 15:40:02
Okay. So for C4D user's, a layered material can be used here with an empty material and a normal direction shader as a mask. ;)

(https://forum.corona-renderer.com/index.php?action=dlattach;topic=36162.0;attach=164357;image)
Title: Re: Decal on thick glass
Post by: Pepelecrabb on 2022-04-19, 21:43:05
Thanks all. Beanzvision, That works!  Wish I would have thought of it. I already had the layered material made because it's the old method of making a label but I didn't think of throwing it on a Decal to see what happens. Only thing is I can't get it to show blank paper on the back of the decal, which did work with the old method of applying the layered material to selected polygons. Also can you be more specific on what you mean by an empty material?   

romullus, not sure what you mean by "Corona front/back texmap in opacity"?
Title: Re: Decal on thick glass
Post by: romullus on 2022-04-19, 22:10:53
romullus, not sure what you mean by "Corona front/back texmap in opacity"?

It's 3ds Max terminology, it might be that in C4D it's named differently, or it's doesn't implemented yet.

Regarding the back side of the label, you can duplicate the decal object, rotate it by 180 degrees and apply appropriate texture. Technically it's not correct solution, since it would project on inside wall of the bottle, but i think one couldn't tell the difference visually.
Title: Re: Decal on thick glass
Post by: Pepelecrabb on 2022-04-20, 13:42:32
romullus, not sure what you mean by "Corona front/back texmap in opacity"?

It's 3ds Max terminology, it might be that in C4D it's named differently, or it's doesn't implemented yet.

Regarding the back side of the label, you can duplicate the decal object, rotate it by 180 degrees and apply appropriate texture. Technically it's not correct solution, since it would project on inside wall of the bottle, but i think one couldn't tell the difference visually.

I thought so, C4D has front/back under projection which I tried, stacking a blank material for the back. Didn't work and a side note...It causes issues with the Corona IR having to be restarted for each change.

Your solution is really thinking outside the box! Unfortunately that does not work either. I assume because of the need to use the Normal Direction shader in the layered material.