Chaos Corona Forum

Chaos Corona for Cinema 4D => [C4D] Feature Requests => Topic started by: aler on 2019-12-11, 21:08:37

Title: Invert Textures
Post by: aler on 2019-12-11, 21:08:37
When I got acquainted with Corona, liked the ease and convenience of working with materials. But then noted that some functions are not enough. In particular Invert for textures.
1) Screenshot 1. For example VRay in the Alpha channel has an inversion, which is sometimes convenient, but it wouldn't hurt for Corona.
2) Screenshot 2. Even more there is a need for invert function in the Reflection channel, because there are not always Glossiness textures, but instead Roughness. Also for more accurate adjustment (or temporarily turn off) it would be useful Mix Strength.
Title: Re: Invert Textures
Post by: Beanzvision on 2019-12-12, 10:51:55
Hi, Why not use the Corona color correct shader to invert it?

(https://forum.corona-renderer.com/index.php?action=dlattach;topic=27215.0;attach=116908;image)
Title: Re: Invert Textures
Post by: houska on 2019-12-12, 11:05:16
If you want to be exact, do note that Reflection roughness vs. glossiness are not a simple inversion of each other. It's actually like this:
Code: [Select]
glossiness = 1 - Sqrt(roughness)
Title: Re: Invert Textures
Post by: romullus on 2019-12-12, 11:12:10
If you want to be exact, do note that Reflection roughness vs. glossiness are not a simple inversion of each other. It's actually like this:
Code: [Select]
glossiness = 1 - Sqrt(roughness)

Never heard that. Is there blending mode that would convert roughness to glossiness "correctly"?
Title: Re: Invert Textures
Post by: houska on 2019-12-12, 11:15:15
I am not sure what you mean by "blending mode", Romullus?
Title: Re: Invert Textures
Post by: romullus on 2019-12-12, 11:39:19
Well, i mean how do you convert roughness map to glossiness properly if simple invert is not good enough? I thought maybe it somehow can be done in photoshop or inside 3ds max or cinema with the help of Corona mix node and one of its blending mode?
Title: Re: Invert Textures
Post by: houska on 2019-12-12, 12:35:13
Oh, I see. Well, I personally would use the C4D Filter map. We haven't got any special map for this at the moment, I'm afraid.
Title: Re: Invert Textures
Post by: aler on 2019-12-12, 18:55:34
Hi, Why not use the Corona color correct shader to invert it?
Wow!, sorry, my omission, didn't see it.
The thing is, I have a pretty bad impression of the "Corona Bitmap" shader and I used it only for Displacement: Color Profile > Linear. That's all. But "UV Tint" and "Crop / Placement" - this is some darkness. I tried to understand independently, but did not work out, and no Help.
For this reason also didn't look in the "Corona Color Correct" shader. But now I'll know.
However option "Invert" would not be superfluous, and "Mix Strength" for Glossiness especially.
Title: Re: Invert Textures
Post by: Cinemike on 2019-12-13, 00:38:23
Oh, I see. Well, I personally would use the C4D Filter map. We haven't got any special map for this at the moment, I'm afraid.

How would I apply "glossiness = 1 - Sqrt(roughness)" in "node speak"?
Title: Re: Invert Textures
Post by: Nelaton on 2019-12-15, 13:36:14
Also, one can use the black point/white point of the texture loaded and simply invert it. (not talking of the conversion of roughness map here), only the image inversion

Nelaton
Title: Re: Invert Textures
Post by: Cinemike on 2019-12-19, 05:33:34
Oh, I see. Well, I personally would use the C4D Filter map. We haven't got any special map for this at the moment, I'm afraid.

How would I apply "glossiness = 1 - Sqrt(roughness)" in "node speak"?

It is pretty easy to create such setup with C4D's native nodes, which do not work with Corona.
So I tried a filter with mirrored horizontal and a gamma of 2.2 which gave me a visually close outcome (comparing C4D nodes and my "creation"). Could I be close?
Title: Re: Invert Textures
Post by: davetwo on 2019-12-19, 11:09:06
For simple conversions I just swap the black point (screenshot A).

I imaging you could just mimic the 'one_minus_sqrt_x' values in the gradation curves filter?  (Screenshot B).

Dunno how accurate that would be though.


Title: Re: Invert Textures
Post by: Cinemike on 2019-12-20, 01:33:35
1 show swapped white/black points, until now I did it this way - awfully wrong, as it seems. Same result like simply inverting the texture in the filter (mirror(.
2 is the result with C4D nodes (the ones for the internal renderer), true maths involved and it looks "proper".
3 is a "mirrored curve", manually adapted as you did.

3 is the closest, so I will use this method for the future when I don't have a glossiness map.
I think, here's where the Corona team should add some automatism (or a few math nodes).

PS
I will use a curve preset, of course.
Title: Re: Invert Textures
Post by: burnin on 2019-12-20, 02:41:09
yup, Filter Gradation Curve does it easily, since there's a Spline preset (Square) which you then flip Horizontally ;) // right m-click menu
Title: Re: Invert Textures
Post by: houska on 2019-12-20, 10:05:25
Thanks for that, burnin! Good tip! The correct way to do it would be "Spline Presets" -> "Root" and then "Flip Vertical". That's exactly what is needed to get 1 - sqrt(x) ;-)
Title: Re: Invert Textures
Post by: Cinemike on 2019-12-20, 17:08:46
... and you can save your flipped curves as a new preset.
Thx everybody for their input!

Have a great weekend,
Michael
Title: Re: Invert Textures
Post by: burnin on 2019-12-22, 04:23:00
Thanks for that, burnin! Good tip! The correct way to do it would be "Spline Presets" -> "Root" and then "Flip Vertical". That's exactly what is needed to get 1 - sqrt(x) ;-)
oh, missed that :D thanks

looking at it again, there's also a "Custom..." option which asks for formula/function and allows any number of control points ;)