Author Topic: Invert Textures  (Read 2766 times)

2019-12-11, 21:08:37

aler

  • Active Users
  • **
  • Posts: 45
    • View Profile
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.

2019-12-12, 10:51:55
Reply #1

beanzvision

  • Corona Team
  • Active Users
  • ****
  • Posts: 1603
  • Bengamin
    • View Profile
    • Cormats
Hi, Why not use the Corona color correct shader to invert it?


2019-12-12, 11:05:16
Reply #2

houska

  • Corona Team
  • Active Users
  • ****
  • Posts: 1509
  • Cestmir Houska
    • View Profile
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)
« Last Edit: 2019-12-12, 11:09:57 by houska »

2019-12-12, 11:12:10
Reply #3

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 6532
  • Let's move this topic, shall we?
    • View Profile
    • My Models
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"?
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2019-12-12, 11:15:15
Reply #4

houska

  • Corona Team
  • Active Users
  • ****
  • Posts: 1509
  • Cestmir Houska
    • View Profile
I am not sure what you mean by "blending mode", Romullus?

2019-12-12, 11:39:19
Reply #5

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 6532
  • Let's move this topic, shall we?
    • View Profile
    • My Models
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?
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2019-12-12, 12:35:13
Reply #6

houska

  • Corona Team
  • Active Users
  • ****
  • Posts: 1509
  • Cestmir Houska
    • View Profile
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.

2019-12-12, 18:55:34
Reply #7

aler

  • Active Users
  • **
  • Posts: 45
    • View Profile
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.

2019-12-13, 00:38:23
Reply #8

Cinemike

  • Active Users
  • **
  • Posts: 564
    • View Profile
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"?

2019-12-15, 13:36:14
Reply #9

Nelaton

  • Active Users
  • **
  • Posts: 55
    • View Profile
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

2019-12-19, 05:33:34
Reply #10

Cinemike

  • Active Users
  • **
  • Posts: 564
    • View Profile
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?

2019-12-19, 11:09:06
Reply #11

davetwo

  • Active Users
  • **
  • Posts: 81
    • View Profile
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.



2019-12-20, 01:33:35
Reply #12

Cinemike

  • Active Users
  • **
  • Posts: 564
    • View Profile
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.
« Last Edit: 2019-12-20, 01:38:27 by Cinemike »

2019-12-20, 02:41:09
Reply #13

burnin

  • Active Users
  • **
  • Posts: 937
    • View Profile
yup, Filter Gradation Curve does it easily, since there's a Spline preset (Square) which you then flip Horizontally ;) // right m-click menu

2019-12-20, 10:05:25
Reply #14

houska

  • Corona Team
  • Active Users
  • ****
  • Posts: 1509
  • Cestmir Houska
    • View Profile
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) ;-)

2019-12-20, 17:08:46
Reply #15

Cinemike

  • Active Users
  • **
  • Posts: 564
    • View Profile
... and you can save your flipped curves as a new preset.
Thx everybody for their input!

Have a great weekend,
Michael

2019-12-22, 04:23:00
Reply #16

burnin

  • Active Users
  • **
  • Posts: 937
    • View Profile
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 ;)