Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - dubcat

Pages: [1] 2 3 ... 29
[Max] Tutorials & Guides / Re: Specular To IOR (OSL)
« on: 2021-06-23, 05:29:35 »
Maybe if you'd visit frequently enough, probability wave eventually would collapse to the version of reality where it's already implemented? :]


I'm still trying to understand this IOR thing. I hope you guys can give me hand:
1) Why exactly is this IOR map needed and what is the physical phenomenon this map is trying to simulate?

Specular/IOR map is there to help the engine fake depth. Because engine wise we are not there yet.

2) Should we use IOR map for skin only or for all materials?


3) Is this method needed when using V-Ray too?

Yes. Unreal 5 too

4) How do I get IOR maps when all I have is a diffuse texture?

Every studio has its own way of generating specular/ior maps (Pro studios tends to use Artomatix). The most common way is to base them on a cross specular maps, and then invert the map, and do some custom adjustments until everything matches the reference. But if you only have a diffuse map. I would generate a normal map, with the best software you could get your hands on, and use the depth channel of the normal map to generate an IOR map. I believe I have a post on the forum on how to do that?

PS to Basshunter: Jag kænner en bott, hon heter Anna, Anna heter hon, SKAAAAAAL.

[Max] Tutorials & Guides / Re: Specular To IOR (OSL)
« on: 2021-05-01, 03:30:06 »
I'm also looking forward to UE 5

Me too!

Ive missed these dubcat posts.


Can I ask you a clarification about the use of megascans textures?


Just ask yourself, does this texture contain Color Information or Data Information.

Color Information would be Albedo/Diffuse/Translucency
Data Information would be Normal/Displacement/Roughness/Glossiness/Bump/IOR/Specular

Color Information = Load as sRGB / 2.2 Gamma
Data Information = Load as RGB / Linear / 1.0 Gamma

I've never used Cinema 4D, so I have no idea how they handle stuff.
I force gamma settings no matter what engine I use. In Unreal there is an sRGB switch per texture.

There are two kinds of normal maps. OpenGL and DirectX, the only difference is how they handle the Green channel.
In 3dsMax we have to load Megascans Normal Map as linear/1.0 gamma and then check the "Flip green (Y)" box in CoronaNormal.
I would download a material like "MOSSY STONE FLOOR" on Megascan, if I were testing a new engine. This material has indents in the stones, if these indents protrude, you should flip green.

Displacement map is another story. These maps should be 32bit float. But that is not the case with online stores.

If I scan my face, retopo my face, project all the details, export the difference as a 32bit displacement. I can load that linear map and use 1 displacement strength, and I will get correct minus/plus values, just as they were exported. Basically a 1:1 result.

If I exported the same map as 16 or 8 bit, the only difference is how jagged the edges are. I would have to input what the min/max values should be. We have to remap 0/1 to a new value. Because a 16/8 bit map can not go bellow 0 or above 1. Please just export displacement maps as 32bit. Megascans include the min/max values inside the .json file as cm.

But in the end, if you download textures from a site that has no standards, and they have done some inverse gamma on the albedo, and you load the map properly, it will look like shit. sadge

PS. When are we getting in Corona peepoWide

[Max] Tutorials & Guides / Specular To IOR (OSL)
« on: 2021-02-17, 01:37:11 »
Recently I got an email about Unreals new MetaHuman, so I thought I could begin to port all the shaders over to Corona for fun in my spare time.

All this porting made me realize how sick I am of the "offline renderer" bias towards IOR instead of Specular. Back when I was the main Corona exporter coder for Megascans, I made a "SpecularToIORv2.3dl" LUT to handle this problem.
Since then, 3dsMaxs OSL support has evolved, and we can do this stuff in engine.

Specular could be implemented in the new Corona Physical Material in a few minutes. We only need to remap pixel values from Specular to IOR, and everything will work as it is.

Specular = 0.5 is the same as IOR = 1.50
(0.08*Specular )*100 = 4 Reflectivity ----- (if Specular is 0.5)
1/((2/(sqrt((Reflectivity /100))+1))-1) = 1.50 IOR ----- (if Reflectivity is 4)

I've made an OSL that will handle all this stuff for you, but I really hope that we can get a switch in Corona to toggle between IOR/Specular.



1. Epic generates a detailed roughness map from the normal map, using the "Composite Texture" part of a texture file in Unreal Engine 4. If you join the UE4 dev group on GitHub you can see the actual code. (and the Blue fix for ACES, wink, wink)

2. Epic custom paints a custom map with broad stokes, to specify what the base roughness value should be.

3. Epic blends the custom painted controlled roughness map with the "Composite Texture" roughness map.

4. Epic use a Fresnel to control and fade between the painted and generated map.


1. Epic generates a Cavity map and remap it to specular values aka IOR.

I always go for cross polarizing specular maps. Cavity generated maps, and if I don't have anything else. I generate a spec map based on the normal map depth, maybe there are just a few pixels on the Z depth, but it's worth it.


1. Epic has a normal map based on scans

2. Epic use a generated detailed "micro" scan. That kind of looks like your average leather sofa.

3. In our example. Epic use a gradient map, to make a mask that specify where the face detail should be, and where the neck portion should be. Because we want less micro detail bellow the neck.

4. Epic blends the scanned normal map with the Generated "leather sofa" map.

I've always been an advocate for IOR/Specular maps, and this is why!

Only Roughness (Corona Physical Material)

Roughness + IOR (Specular) (Corona Physical Material)

Roughness + IOR (Specular) + Normal

Roughness + IOR (Specular) + Normal + Albedo (Default SSS settings with 2cm)

I've over emphasized the IOR/Specular map in this example with no depth of field, just to show you how important this map is.

Lol exactly, yes, input values would be great. To be sure, I am envisioning something more like this:


I would love a Level Adjustment feature. But actual value input in the current Curve editor would go a long way!

Work in Progress/Tests / Re: dubcats secret little hideout
« on: 2019-10-04, 03:39:42 »
Dunno but I think something's not right with the girl's brows.


images are a lot more "analogue" in the way noise is distributed/cleared, it's quite a lot closer to film.

I know exactly what you mean!
I was talking with the devs a year ago or maybe two, and this feature was included in the early Corona builds, but they had to remove it for some technical reason.
You can manually adjust the "Image Filter (Width [px]) in Systems or find VFB blur setting that mimic this 1 perfect pixel 50% side blur effect. VFB blur has to be adjusted if you change render size.

fstorm sample

corona sample

And as far as I know, Corona IS actually using GGX shader?
Yes as nkilar responded.

Work in Progress/Tests / Re: dubcats secret little hideout
« on: 2019-09-28, 03:41:17 »
+1 on the learning of how to extract and make usable LUTS from specific camera profiles, I have a D810 and I'd love to being to extract the response curves of the various picture modes (Standard, Neutral, Flat, Landscape etc) and use them as LUTS or Curves in VFB.  It would make camera matching lighting and colours an absolute dream


To me it looks like reflection gets sharper towards the light source, just like in fstorm, but maybe I'm wrong.

The devs told me that this effect should be included in the GGX shader.

Is it still working? apparently you blocked PMs

I didn't have much time to be active on Discord, so this project was a big fail on my side. Sorry about that. I really feel bad about the whole Discord situation, sorry again for everyone that joined. I really appreciate you.


Sylvanas Windrunners facial animation and those teeth in the last Blizzard Cinematic is just unreal! GG!
I usually dread CGI trees and CGI teeth, but damn, Blizzard got it right this time.

I take it youre an fstorm user now?


I still use Corona / 3dsMax professionally, but I always stress test other render engines. My current absences is not the result of an engine switch. I'm happy with the current Corona development, but there are currently two SUPER important features that are lacking in Corona. Fabric BRDF ( You have to copy paste the URL, the direct link URL will redirect you to the index) and Burley Diffuse Roughness
Both these features are included in MaterialX that even Substance Designer/Painter has implemented.


I'm having a hard time sleeping and thought, why not do a random dubcat google search, and here I am.

RAL 7038 is pretty easy to convert to Albedo. RAL 5008 will get clamped because the LRV is 4%. I don't know if Autodesk is the culprit, but both Corona and Vray will clamp these values to 0 RGB.


I forgot to answer the gloss question. Real world materials usually don't go bellow 0.4 PBR glossiness. 13 gloss level does not equal to 0.13 pbr glossiness.

This is fstorms glossiness level mapped to PBR glossiness.

Current PBR glossiness does not exceed the material IOR. So if you do a cross polarized material scan of asphalt, and normalize the scan based on the F0 of the asphalt. And generate a glossiness/roughness map base on the asphalt F0. The gem stones in the asphalt will not have the correct IOR. Because the gemstones can not exceed 1.5 IOR. We need a new shader that read both glossiness/roughness and IOR/Specular at the same time. Modern render engines can not fake this stuff with geometry. Corona is stil using complicated IOR instead of real world easy math Specular.

Work in Progress/Tests / Re: dubcats secret little hideout
« on: 2019-06-28, 04:07:28 »
Moto G6 by Motorola.

This is one of those rare cases where I don't have a camera profile. You can either capture a raw photo with a mobile app and we can extract the camera profile from the raw image. Or you can generate an optimal camera profile with an Xrite, and then we can linearize the generated profile.
I hope to be more active online soon, proper linear profile guide is one of my top priories.

what is the correct way to getting the accurate IOR values?

My generator is based on IOR 1.5 and will high pass all input maps. I will port my code to 3dsMax and post it here, that way you guys can make adjustments if you want. Instead of having a static LUT.
I rarely use LUTs nowadays. Most stuff can be done with Coronas Curve editor in combination with hacky stuff between the two VFB tonemappers.

Best result would be:
#1 Specular Scan (Photo real result). (Look at your TV plastic controller, when you rotate it, it will give you micro spectacular results. But when you view it direct on, it will look diffuse. This effect can not be captured with a normal map.)
#2 Normal Map (Height Based, better than nothing.)
#3 Old Reflection custom fantasy maps (Nothing to do with real world values. 99% of online stores)

I began porting the code, and where the hell has the Corona Bitmap Blur property gone ? It was the only reason for me to use Corona Bitmap, as it behaved as a super blur for highpass.
We need a corona map that has gaussian blur, this missing feature is killing a lot of dynamic and procedural map generation ideas.

edit: typo = port -> post

Work in Progress/Tests / Re: dubcats secret little hideout
« on: 2019-06-22, 04:38:54 »
hi dubcat! how do we get correct IOR values when we do not have a scanned glossiness texture to use it with a LUT? can we use the normal texture with a LUT?
I have a LUT that converts old reflection maps to IOR and a Corona map setup that converts normal maps to IOR. I thought I shared it a while back, maybe I never got that far. I will compile them as soon as possible!

Do you also correct height maps or just adjust min/max displacement levels in Corona?
I've never tried the CC0 maps. If I only have a shity 8/16bit displacement map. I usually project them in Zbrush on a plane with a height value that looks reasonable. That way I can clean the nasty artifact if there are any, and export them as a proper 32bit map. When it comes to Megascans, you can get the proper height value inside the .json file, just search for "height". I don't know if Quixel have included my latest Corona exporter in Bridge 2 yet, the script takes care of all that stuff and more.

Not even what one would expect from a linear rendering to look like.


DCRAW is really good at everything except color profiles and noise reduction. Because of this I changed my workflow a while back. My current workflow is to generate a linear profile for my camera and load the photos in Lightroom with that custom profile. I can generate a profile for you when I get time, just tell me the manufacturer and model. I'll also compile a camera curve that you can load in Coronas VFB curve editor.

I have a lot of pages to read through!

Work in Progress/Tests / Re: dubcats secret little hideout
« on: 2019-02-16, 02:02:38 »
I've been analyzing a bunch of professional Scandinavian interior photos (that still contained lightroom exif data, we can extract this data, and remake the original photo. It won't be 1:1 to the original, but it will get us in the ballpark), and this is the average color matrix they all use.
I was wondering how close we could get to this color matrix using Corona VFB Saturation. -0.075 seem to get us pretty close.
I found it interesting that Coronas VFB Saturation is not "linear" in the way that all the colors get reduced (You can see that blue gets reduced more). I'm not complaining (since this is how the photos are behaving), just found it interesting.

Work in Progress/Tests / Re: dubcats secret little hideout
« on: 2019-02-09, 22:31:26 »
Why not just use the hex color code if you want to match the paint in the corona color picker? Still a workaround but none the less it gives accurate results correct?

If you already have the paint value with correct LRV and - IOR, this solution works fine. The paint swatches that most companies use in Norway do not factor LRV/IOR.

You can see here the swatch from the Dulux website for "Scotts Pine"

Looks like Dulux take LRV and IOR into account on their online swatches, if only all paint manufactures did this.

But you can do that with CoronaColor texmap too, why use Vray's map?

The thing with CoronaColor is that if you switch to "Solid HDR color", it overwrites the color you have sampled. While VrayColor does not force any workflow, you can sample the color and still have linear float.

Work in Progress/Tests / Re: dubcats secret little hideout
« on: 2019-02-08, 04:08:15 »
I remember you did a thread on virtual colour checkers.
How would that work with ACES Emulation?
Would you apply aces settings and your LUT and then use the output in lightroom to calibrate?
Colour management is all very new to me but its infinitely fascinating to get into the process of making sure my work output is accurate.


I would capture a color checker passport at your current light intensity. Generate a camera profile. If your profile has a contrast curve, open it in 3DLUTCreator and remove it. This should give you a calibrated color and linear camera profile.
When you have a calibrated profile. The only thing you should care about is linear values. When it comes to real world albedos, we talk in linear %. If I tell you the brightest common paint is 94%, you should be able to input that value into "Value" in Corona Picker. But that is not how Corona Picker is working right now. So you have to convert 94% to sRGB. If you are thinking, why the hell do we have to gamma correct a linear value only to get a linear value, ask the Corona devs, it blows my mind every day. 94% is 97.2% sRGB, so this is the max real world scanned common paint value.

Another problem we have with the current Corona Picker is that the darkest common paint is "Jet Black" and it's 14,14,16 sRGB. Try to input these values into Corona Picker. You end up with 0,0,24 sRGB. This is a common problem when we try to sample real world values for products, the sRGB values might jump 10 sRGB. I'm using Vrays color map to fix this, because it let me adjust values separately with float values.


I haven't had much time to complete the last few guides on my site. But I want to share paint values with you guys as soon as possible, so I have remove all the unfinished stuff from the site.
I've only had time to add the 2019 Color Chart paints to the page, but have about 1 gazillion paints ready.
If you have a paint value, and are wondering how it would look with LRV and - IOR. Just post the values here, and I'll add them to the page when I get time.

Off-Topic / Re: catnip sessions
« on: 2019-02-03, 05:53:50 »
catnip sessions (Top January 2019)

ฅ^•ﻌ•^ฅ meow purr purr.

01. Catnip Sessions - Intro
02. Hardwell feat. JGUAR - Being Alive
03. Terry McLove - Alive (MOTi Edit)
04. Madison Mars x Lucas & Steve - Lunar
05. Habstrakt - Darkness
06. Wolfpack & Eastblock Bitches - Apache Anthem
07. Mike Williams - I Got You
08. Deniz Koyu - Eclipse
09. Klaas - Figure Out
10. ALOK & Timmy Trumpet - Metaphor
11. Juicy M vs. Subshock & Evangelos - Psyhaus

Pages: [1] 2 3 ... 29