Author Topic: GGX - best way to recreate it for all metals, problems translating to Corona  (Read 78793 times)

2014-06-22, 07:56:24

gleelash

  • Active Users
  • **
  • Posts: 8
    • View Profile
Hey guys, my first post.

About that custom BRDFs and GGX reflections, I gave it a go for Gold, since it may be trickier than non colored metals such as Platinum or Silver.

SUPER cool looking gold setup for V Ray. As you can see you need to overkill and blend 3 materials (or more) with different glossiness: 0.8 + 0.9 + 0.99. It's what I call the Grant Warwick BRDF (although he compiled it from others on forums, etc, all credit towards everybody, can't remember their names), I was not smart enough to create this method though I made something similar (yet crappier) years ago for Maxwell Render.
How does he do it?

1.Wikipedia Red + Green + Blue (see attachments.) Those gives us the wavelength of these colors. You can use min or max values, or equal them out. (for my gold I used max).

2.Then go to http://www.refractiveindex.info, plug that in with a 1/1000 modifier (nm units vs µm, so 450 becomes 0.45 in the Wavelength parameter of the website). Then select AU (GOLD) under BOOK ( I kept Rakic method ).

3.OK then scroll all the way down to REFLECTION CALCULATOR. Yeah it's a graph, only diff between it and max is that this one is from 0 to 1 up, 0 to 0.9 left-to-right. So I multiplied everything horizontally with 1.11111. Yes I am a freak. ONLY USE THE GREEN GRAPH.

 4.Use WARD not BLINN (better for metals). In your material reflection slot, use a FALL-OFF map, use the GREEN only graphs for the RED, GREEN and BLUE calculations. That will give you a custom RGB fall-off like in this picture. I tried to be as close to reality as I could, but please take everything with a grain of salt, don't over tweak it! Minute differences probably can't even be sensed. You got the values roughly to put in 3ds max, a 0.05 difference won't kill your production. Just remember the 1.111 multiplier horizontally since the website goes from 0 to 0.9 and max goes from 0 to 1. See below:


5.Ok you created a base custom BRDF. To get it to GGX status, since it's only a WARD now, blend 2 to 4 materials together. 4 might be overkill unless your machine is really into computing power. Make a V Ray Blend - change only the glossiness (BEWARE: Fresnel IOR turned off, you DON'T need it, you got a custom Fall-off born from physical calculations). So a 0.8 + 0.9 + 0.99 3 way blend should do fine. I used this as blend map:


So the result is:

_______________________________________________________________________________________________________________________________________

BOOM. GGX super shader for gold. I apologise for using mister Warwick's renders but since my video card exploded my 4770k goes up to 95 degrees so I can't render, I will use his scene:
This is the comparison, this is why you want a GGX and not a simple WARD:


6.I had slight problems recreating this with Corona, since I only got A6 literally 7-8 hours ago. But the script did translate to BLEND - 2 corona materials into a 2 way BLEND + another corona material. So I had all 3. So it looks like this:


Basically: BLEND-->BLEND-->Corona 1 glossiness minimum (still high, equivalent of V Ray's 0.8)
                                         -->Corona 2 glossiness medium  (still high, equivalent of V Ray's 0.9) 
                         -->Corona 3 glossiness medium  (still high, equivalent of V Ray's 0.99) 
So far so good, no problems, 3 gold materials with 3 different glossiness factors. Victory! But wait...

_______________________________________________________________________________________________________________________________________

What bummed me out:    

A. Can't turn off IOR. And it translated to IOR value of 999.999. That can't be right, since most specialised websites say IOR of Gold is 0.47. So yeah, minor tweaking. Copied a gold material presented on the forum for Corona with IOR of 100 (still can't be right...). So I need help here.

B. Reflection Color. I don't know why this is there. My custom RGB enabled Fall-off does a fantastic job, why do I need to add another color here? Feels a bit cheap and linear, when I put all that work for a calculated, really close to reality custom fall-off...  So I need help here.

C. For the blend map the falloff I made simply does not work.So I need help here.

Here are some screenshots of material previews so you can see what I'm saying here and maybe you can help me translate my bad-ass gold into corona:

1. Corona 3 way blend material: a.reflection level 0.95
                                                       glossiness 0.8
                                                       Fresnel IOR 4.7 and not 100 + Color + Fall-off RGB calculated above
                                                      b.reflection level 0.95
                                                       glossiness 0.9
                                                       Fresnel IOR 4.7 and not 100 + Color + Fall-off RGB calculated above
                                                      c.reflection level 0.95
                                                       glossiness 0.99
                                                       Fresnel IOR 4.7 and not 100 + Color + Fall-off RGB calculated above
2. Corona simple material: reflection level 0.95
                                           glossiness 0.8
                                           Fresnel IOR 100 + Color Black + Fall-off RGB calculated above     
3. Corona 3 way blend material: a.reflection level 0.95
                                                       glossiness 0.8
                                                       Fresnel IOR 100 + Color Balck + Fall-off RGB calculated above
                                                      b.reflection level 0.95
                                                       glossiness 0.9
                                                       Fresnel IOR 100 + Color Black + Fall-off RGB calculated above
                                                      c.reflection level 0.95
                                                       glossiness 0.99
                                                       Fresnel IOR 100 + Color Black + Fall-off RGB calculated above
4. Corona 2 way blend material: a.reflection level 0.95
                                                       glossiness 0.8
                                                       Fresnel IOR 100 + Color Yellow (as close as what my eyes tell me gold is)
                                                    b.reflection level 0.95
                                                       glossiness 0.99
                                                       Fresnel IOR 100 + Color Yellow (as close as what my eyes tell me gold is)

OK enough detailing, this is what they look like:

Off the bat:
Fresnel IOR can't be 1.47, it has to be as close to 100, but I feel is gets way too close for chrome so...I don't fancy it in my production. This fresnel IOR definately works way different than V Ray. But how much different?So I need help here.
Blending 3 different glossiness materials achieves absolutely nothing.2 and 4 look exactly the same. Except a longer rendering time.So I need help here.
A black color in the reflection lets my custom fall-off calculated map shade the reflections so yay! on that achievement.
A custom color in the reflection is very crappy when trying to produce real material shaders.

So you can use this custom fall-off calculated method in Corona Render A6, but still blending different gossiness materials results in nothing. So can't really mimic a custom GGX shader for materials, although the result is WAY BETTER in some ways compared to a simple WARD or BLINN. So you may not need to, although I grew accustomed to the level of control it offers.

I know this is a big ass post, I know at least some may find it confusing, but I know there people a lot smarter than me lurking on these nice forums, so help me put this together, so we can render unbiased REAL WORLD calculated METALS of ANY kind. I think this is important.

CONCLUSION:
That custom Falloff map that you can calculate on the website and recreate in 3ds max is really useful.
I am messing up something with my fresnel IOR or something, gold is no way near that close to chrome and my Camera IEV settings had to be dropped to -3 for this not to be nearly white renders.
I can't seem to blend 2-3 versions of the material to get that GGX flavored reflections, blending right now does nothing, all reflections are uniform which really pisses me off.
Here are some test renders, custom Falloff RGB calculated VS Simple Color in reflective slot, rest are the same: Fresnel IOR 100 / Level 0.95 / Glossiness 0.9:

Let's ignite this conversation! And please message me if I posted in the wrong section, I just wanted to show how you can achieve a GGX style shader in V Ray then translate that level of control to Corona which for now I simply can't. We can figure this out!
« Last Edit: 2014-06-22, 09:43:46 by romullus »

2014-06-22, 13:13:20
Reply #1

rampally

  • Active Users
  • **
  • Posts: 208
    • View Profile
I think we all should ask for GGX shader in corona as its been implemented in vray3
so that  keymaster CAN and may be implement it in  beta version ?? or for final release ...........
any how i saw Grant Warwick  tuts i felt its another great achievement like when i found corona A5....i too have same question like you ..however solution will be GGX...so lets request GGX

2014-06-22, 13:25:25
Reply #2

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile
motivate me ;)

are they any comparisons showing some real difference, comparisons using anything more complex than one ball on one plane?
Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)

2014-06-22, 13:39:36
Reply #3

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8833
  • Let's move this topic, shall we?
    • View Profile
    • My Models


2014-06-22, 14:02:17
Reply #5

Juraj

  • Active Users
  • **
  • Posts: 4762
    • View Profile
    • studio website
Lol, dear god, I am glad to see these threads pop up :- ). Just yesterday night I told myself I will need write HUGE FUCKING BLOG why we want better shader, complex BRDF, layered speculars inside single materials, blended material, roughness affecting both diffuse and specularity or atleast complex IOR.
[rendering all those examples will give me headache probably...I wish someone talented could instead...but I really want this, like over9000 want this]

Yep, if Keymaster needs motivation, I will do so.

But frankly, Vray already has GGX in nightlies, countless of users have confirmed once starting to creating more complex materials, that this is the way to go.
I might test those two plugins from Sergey as well, for now for 3dsMax there are only GGX (Sergey's GGX has 'power' parameters for tail, Vray not yet), ABC (full peak/tail),
but he doesn't have time to convert the most impressive last one, ShiftedGammaDistribution which has all of above, plus 100 MERL Presets.

Almost every renderer has the same featureset now, or building towards it slowly. This is one thing that can mix the cards, bring back some new fun, and revolutionarize the workflow.
This should be much bigger priority imho than integrating bullshit from past.

When I have time I will show my examples of metals (layered metals such as Oxidized Blackneeded Steel,etc...), but in meantime I think Grant does awesome job (I have evolved the workflow a bit too though )
And of course...the above video !! Everybody throw some money on Sergey so he can port it to Vray for now atleast :- ) Or hire bit of his time so he can port them to Corona.
I mean come on, this stuff can definitely give brutal edge on competing renderers like nothing else can. It's already everywhere else ( Disney, Pixar, Unreal4,....).


Btw Gleash: What do you mean with the horizontal stretch ? If you refer to Refractive index, it goes from 0-90 angle of incidence, therefore it's ok to interpolate it identically between 0-1. Same stuff. Or maybe I don't understand you correctly.
I am surprised you mention regular blend doesn't work the same as VrayBlend. I will have to try mysel, did you put the fallof curve into mask slot ?
999 IOR in Corona should be equal to no-IOR in Vray. But I didn't try.
Using simple IOR (8-40) for Metals will always give shitty metals. It looked wrong to me eyes long before I've see Bertrand mix his metals 2 years ago (although he only eye-balled it, didn't give the scientific reason) and of course, Grant few months ago.
The difference can be from small, to drastic, the latter when material features quite strong "retro-grazing" reflection. So the curve (without doing the "Well, what random value will I put today into specular slot?") in reflective slot dealing with intensity from 0-90 angle is just superior. Chrome looks like Chrome, Gold looks like Gold.

Disney-PBS_BRDF white paper http://disney-animation.s3.amazonaws.com/library/s2012_pbs_disney_brdf_notes_v2.pdf

Imho the best stuff on this. On page 9/10 is shows the correlation between albedo and specular in GGX/Roughness type of shader and the various curves fitted from MERL data.
Having their version of material would be a dream. What is funny it's like 90perc. identical to what I have in Unreal4 [metalness/roughness/GGX/base reflection]. If current realtime engines share the same model high-end
companies like Disney, MPC, ILM (all have PBR/PBS materials), yet we're still stuck with unlinked specular/glossy material harkening to prehistoric era.
« Last Edit: 2014-06-22, 17:37:50 by Juraj_Talcik »
Please follow my new Instagram for latest projects, tips&tricks, short video tutorials and free models
Behance  Probably best updated portfolio of my work
lysfaere.com Please check the new stuff!

2014-06-22, 17:15:42
Reply #6

rampally

  • Active Users
  • **
  • Posts: 208
    • View Profile

companies like Disney, MPC, ILM (all have PBR/PBS materials), yet we're still stuck with unlinked specular/glossy material harkening to prehistoric era.
yes you are 100% correct Juraj

2014-06-22, 20:10:18
Reply #7

gleelash

  • Active Users
  • **
  • Posts: 8
    • View Profile

Btw Gleash: What do you mean with the horizontal stretch ? If you refer to Refractive index, it goes from 0-90 angle of incidence, therefore it's ok to interpolate it identically between 0-1. Same stuff. Or maybe I don't understand you correctly.
I am surprised you mention regular blend doesn't work the same as VrayBlend. I will have to try mysel, did you put the fallof curve into mask slot ?
999 IOR in Corona should be equal to no-IOR in Vray. But I didn't try.
Using simple IOR (8-40) for Metals will always give shitty metals. It looked wrong to me eyes long before I've see Bertrand mix his metals 2 years ago (although he only eye-balled it, didn't give the scientific reason) and of course, Grant few months ago.
The difference can be from small, to drastic, the latter when material features quite strong "retro-grazing" reflection. So the curve (without doing the "Well, what random value will I put today into specular slot?") in reflective slot dealing with intensity from 0-90 angle is just superior. Chrome looks like Chrome, Gold looks like Gold.

Yeah well like I said, mister Grant's method is great for result, bad for my CPU. Like I said mr. Talcik, I am not that great at this, I have been using V Ray for about 16-18 months, so a better method might be out there. Or buy the GGX kit, like people above stated. And since I'm a novice I didn't think mr. Warwick's method through so indeed I stretched the horizontal slides to be 0-1, didn't get that was a 0-90 degrees reference. Now I am left wondering what the result might look like.

3 materials in V Ray + different glossiness as stated in my post with the falloff map mentioned (need the blending to overlap shininess to create GGX and need it basically according to that curve, not everywhere, if that's a line not a curve then all we are doing is linear and whats the point, this curve blends the result of higher reflective angles). This is said curve:

But Keymaster, rendering those rings with GGX 3 way blend (to compare to simple) is literally overkill for my machine. Not only I have no GPU at the moment, as stated, my CPU goes to 96-98 when rendering. Yes, unfortunately, even in Corona. Need liquid cooling before I can do anything. I\ll definitely pop to a friend tomorrow to render some examples. I am willing to go to every length to get GGX for Corona implemented! It is that important!

I am happy to see I got some responses, from people I actually follow and whose body of work I respect so much. No names, you know who you are.

I WILL supply the any type of scene, as complex as Keymaster wants it, with this "calculated" fall-off 3 way blend gold and maybe some platinum or copper. 6 materials, 3 complex blends 3 simple for comparison. I JUST CAN'T render anything at the moment, so I apologize. Please message me if you want a scene with these materials, or to get my e-mail/facebook/skype for further info, if someone does not understand what the hell I kept on writing at 5:30 AM.

STILL my problem is: can't recreate that gold. OK no blending, but that fall-off seems nice. Useful. BUT still looks like chrome. I'll check mr. Talcik's post maybe I'm thick and I don't get his solution to it yet. I get stuck at that Fresnel IOR and the other field for diffuse. Tried using the fall-off as a map for Diffuse or Fractive (?) slots, but since I have no idea what those do...I'm still lost.

AN IMPORTANT NOTE to KEYMASTER: you removed the FAQ section explaining what every setting does, and I'm afraid my 3ds Max 2014 doesn't pop up anything so I am left blind. It's frustrating because I want to use Corona so badly it hurts. Someone please enlighten me how to get the pop up explanations while hovering in 3ds Max. Thank you.

Also please let me know how am I to bump up a metal shader's own color, since this Fresnel IOR business tends to create really dark spots on my renderings. I need to bump it's diffuse color to show, which is a bit of a hassle considering pure metals usually have 0 diffuse component, and since nature provided us with no such pureness, their diffuse component tends to be the amount of impurities it has, a very, very low fraction.
« Last Edit: 2014-06-22, 20:33:06 by gleelash »

2014-06-22, 20:55:51
Reply #8

Juraj

  • Active Users
  • **
  • Posts: 4762
    • View Profile
    • studio website
Hi Gleash, I didn't doubt you :- ) I didn't try to translate multiple blended materials with VrayBlend into nested material in Corona. I will do so as soon as I can ! Maybe it really doesn't work, which would be sort of odd.
I create all my materials in Grant's way since I follow him early and very much enjoy the results. I did it before too, blending metals, but not with additional curve to glossiness as he shown. Not scientific, but nifty !

Also weird that you get different energy for metals using 0 diffuse between Vray and Corona. I think I found it to be consistent but I didn't check.
Did you try comparing both unclamped ? Vray with Subpixel OFF and Corona with MSI 0 ? Just to see if you're not loosing some highlights.

But first, definitely use the full 0-1 spectrum :- ). At 90angle incidence, almost all of them (not all, some retrograzingly fall close to 0, very funny, like some fabrics,etc..) get there.

I sadly don't have much free time to test it, I am waiting for Corona's blend material, once that will be done, we can do full 100perc. comparison and I am greatly looking forward to that !

[btw,off-topic: Grant's materials are harder to render because 3 blended materials create 3 times more sampling (each VrayBlend compoment samples separately), but it's survivable. With today power.
But definitely doesn't cook your CPU, 90+C are overkill for long time, you don't need water cooling, just well sitting AirCooler. I have 40C top with simple Noctua NH-D14]
« Last Edit: 2014-06-22, 21:01:13 by Juraj_Talcik »
Please follow my new Instagram for latest projects, tips&tricks, short video tutorials and free models
Behance  Probably best updated portfolio of my work
lysfaere.com Please check the new stuff!

2014-06-22, 22:58:28
Reply #9

gleelash

  • Active Users
  • **
  • Posts: 8
    • View Profile
Can't provide the best comparison today BUT I did render in V Ray till my CPU reached about 93 degrees. Short video, the fact that the quality is what it is and you can still see the BIG differences between GGX and Simple is a plus for my crusade.

Sorry Keymaster, I'll get better stuff done tomorrow, on a friends machine. To be clear, the simple one has the most black and plain reflections, looks like it's made of candy wrapper-meets-chrome. And since this is the case, I just realized that the blending in Corona does not work, so I am getting the same simple chrome-like result. Well at least I figured something out.

« Last Edit: 2014-06-22, 23:44:47 by gleelash »

2014-06-23, 04:56:17
Reply #10

rampally

  • Active Users
  • **
  • Posts: 208
    • View Profile


[btw,off-topic: Grant's materials are harder to render because 3 blended materials create 3 times more sampling (each VrayBlend compoment samples separately),
I think for this reason we all need to request keymaster to implement GGX in to Corona ........ASAP

(off-topic keysmaster yestarday  i meet one of my friend he is working  with maya and arnold ...and he is so proud about arnold that no other render can achieve  this level quality with less render time...and the image that  he has rendering  took 28H to complete..... 2k res
and i just told him that it will take less then 3H with much more Q  in corona....he told me to do it i just showed him WHAT IS CORONA he was shocked  and final render just took 2.16 H to complete 400 passes ..........with MUCH MUCH more Quality ...he was Totally shocked
so keymaster i think A7 will rock 3d rendering  and with final release  3d world . )
YOU diverse BIG award for you effort
« Last Edit: 2014-06-23, 06:02:24 by rampally »

2014-06-23, 10:25:14
Reply #11

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile
I would still like to see something like "here is a render + scene with a nontrivial object with GGX, you cannot reproduce this in corona - because I would like to try to reproduce it ;)
Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)

2014-06-23, 10:46:56
Reply #12

gleelash

  • Active Users
  • **
  • Posts: 8
    • View Profile
Well I did not buy the GGX shader for V Ray, but I can sure fake it. I'll prepare a scene, something "non trivial"(? like you could actually see it better in action on a metal bridge rather than jewelry?) with the 6 V Ray materials I talked about in my original post.

2014-06-23, 11:36:42
Reply #13

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile
I think for example the dragon statue is ok. It is just that on a simple sphere it is very simple to see any difference that you would not notice in real scene.
Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)

2014-06-23, 12:04:13
Reply #14

ktulu

  • Active Users
  • **
  • Posts: 33
    • View Profile
Thanks for starting this interesting discussion guys. Since I watched Grant Warwicks’ tutorial on blending materials in Vray I wanted to try and implement this workflow in Corona.
Don’t get me wrong – it would definitely be great to have a shader model, which wouldn’t require us to blend 3 different materials to achieve a realistic metallic effect. Since we don’t have it at our disposal yet, it’s good to have a decent workaround.
So I went on and prepared a simple falloff curve with different RGB values and tried recreating the base coat material to make sure I knew, how a more complex shader would behave. There are a couple of points I would like to clarify before moving on to layering additional coats on top of this one.
  • Plugging a tinted map into reflection glossiness slot doesn’t produce any colored reflections. How is the map being interpreted? Is it being read in as an averaged monochrome map, or does it take the values of the strongest channel? (In this case Red).
  • Plugging a map into the Glossiness slot overrides whatever is entered in the value field (highlighted in the screenshot). The Level value for reflection color however, works in conjunction with the map i.e. I can clamp the output of a map with any value lower than 1.
    Should I be clamping my reflection maps with an additional output map to avoid values close to 255 on the longer end of the spectrum? Or maybe my current setup is totally OK, and doesn’t affect render times at all?

Ok, and last but not least: which method is the 'correct' one to reproduce the metallic effect? Plugging the Falloff map solely into the Reflection color slot (as suggested by the MaterialConverter script), or having them plugged in into both Reflection slots?

I would appreciate your input on this matter.
« Last Edit: 2014-06-23, 12:30:42 by ktulu »