KeyShot Forum

Technical discussions => Materials => Topic started by: bronson on December 04, 2016, 06:49:01 PM

Title: How to use displacement and gloss image from POLIIGON
Post by: bronson on December 04, 2016, 06:49:01 PM
Hi all,

I just joined 30-day trial program of poliigon.com.
It seems incredible source of materials as you folks able to produce incredible results from poliigon materials.

Can anyone explain how to use displacement, overlay, albedo and gloss image?
What is the difference between reflection and gloss?

Thx
Bronson

Title: Re: How to use displacement and gloss image from POLIIGON
Post by: Jikkk on December 05, 2016, 03:16:45 PM
Displacement map is needed in your modeling software, not in KeyShot.
Reflection map defines which parts of a surface are diffuse or glossy, while gloss map defines wether those glossy parts have sharp or rough reflection :-)
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: bronson on December 05, 2016, 03:50:23 PM
Quote from: Jikkk on December 05, 2016, 03:16:45 PM
Displacement map is needed in your modeling software, not in KeyShot.
Reflection map defines which parts of a surface are diffuse or glossy, while gloss map defines wether those glossy parts have sharp or rough reflection :-)

Thx a lot  :)
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: DMerz III on December 06, 2016, 08:34:53 AM
To build on to what Jikk has said;

In most cases you will do the following.
To use the Gloss map, you'll click on the checkered box next to "Roughness" in your material settings. Load the map there.
Use the reflective map in your specular texture channel.

You can edit the intensity each map has by playing with the brightness/contrast sliders for each channel. White = More Insity, Black= No Intensity with the greys being the middle ground of course.

Title: Re: How to use displacement and gloss image from POLIIGON
Post by: bdesign on December 06, 2016, 09:24:03 AM
Also, be aware that although "Gloss" and "Roughness" both use greyscale values to determine the microsurface smoothness and how diffuse the reflections are, they do so in an opposite manner: with "Roughness", black represents perfectly smooth reflections and white represents completely diffuse reflections; with "Gloss", it is reversed. So, when using Gloss maps you can either first connect them to the input of a Color Invert node before plugging in to the Roughness channel, or you can go to Edit > Preferences > Advanced > and enable "Use gloss instead of roughness for materials".

Eric
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: Finema on December 06, 2016, 09:40:30 AM
Quote from: bdesign on December 06, 2016, 09:24:03 AMor you can go to Edit > Preferences > Advanced > and enable "Use gloss instead of roughness for materials".

Eric

Yeeesss ! thanks a lot for this info Eric  ;)
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: bdesign on December 06, 2016, 09:51:30 AM
Quote from: Finema on December 06, 2016, 09:40:30 AM
Quote from: bdesign on December 06, 2016, 09:24:03 AMor you can go to Edit > Preferences > Advanced > and enable "Use gloss instead of roughness for materials".

Eric

Yeeesss ! thanks a lot for this info Eric  ;)
You're welcome, Philippe  ;)

Cheers,
Eric
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: soren on December 06, 2016, 10:44:49 AM
You have to apply the color invert (or color to number). The settings in preferences do not apply to texture maps. The UI may be slightly misleading here - if you notice in the material graph, the input will say "Roughness" - not Gloss.

And for the details: the relationship between roughness and gloss is not linear, so a Color Invert will not reproduce "correct" roughness-values from a gloss-map. I guess however, that the gloss map you apply are not based on actual surface measurements, so it is likely not an issue.
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: bdesign on December 06, 2016, 11:00:03 AM
Thank you for this information, Søren. My apologies for my inaccuracies. I had, in fact, noticed that it still says "Roughness" in the Material Graph, but incorrectly assumed it was perhaps just an UI oversight :). I had also tested the color values when applying the Color Invert (by using the color picker and hovering over the isolated map in the viewport, and did notice that it was not producing the exact inverse, unless I set the Gamma under the image tab to 1). So, I again incorrectly assumed it was a display matter involving gamma. Thank you for this clarification. Again, my apologies for the incorrect information  :-[

Eric
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: soren on December 06, 2016, 11:05:47 AM
No problem - it is a bit of a corner-case anyway. I did not intent to chide, but rather to provide esoteric information :)

Søren
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: bdesign on December 06, 2016, 11:17:55 AM
I didn't feel chided in the least, just happy to be informed :) At least I guess I was somewhat on the right track with the Color Invert step :)

Cheers,
Eric
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: bronson on December 06, 2016, 03:54:04 PM
Wow. Thx for all the inputs.  ;D
I will start playing around with downloaded poliigon maps, especially the color invert method.

Bronson
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: pizzalover2 on December 08, 2016, 05:57:00 AM
So from what I understand:
Use the Advanced 'Material Type' and:

DIFFUSE (COL_VAR1): In the Diffuse channel.
ALBEDO (COL_VAR2): ?
DISPLACEMENT (DISP): In the Bump channel.
GLOSS (GLOSS): In the Roughness channel.
NORMALS (NRM): In the Bump channel? I'm not sure...
REFLECTION (REFL): In the Specular channel.
AMBIENT OCCLUSION (AO): ?

Someone correct me 8)
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: Finema on December 08, 2016, 06:47:43 AM
Quote from: pizzalover2 on December 08, 2016, 05:57:00 AM
So from what I understand:
Use the Advanced 'Material Type' and:

DIFFUSE (COL_VAR1): In the Diffuse channel.
ALBEDO (COL_VAR2): ?
DISPLACEMENT (DISP): In the Bump channel.
GLOSS (GLOSS): In the Roughness channel.
NORMALS (NRM): In the Bump channel? I'm not sure...
REFLECTION (REFL): In the Specular channel.
AMBIENT OCCLUSION (AO): ?

Someone correct me 8)
Just my two cents.
I use Poliigon textures and don't use all the map
Diffuse OK  > is color map
Albedo > don't use it
Displacement > don't use it
Gloss > in the roughness channel
Normal > in bump channel
Reflection > in Specular (sometimes for metallic textures)
Ambient occlusion > don't use it
That's all
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: bronson on December 08, 2016, 04:25:18 PM
Quote from: Finema on December 08, 2016, 06:47:43 AM
Quote from: pizzalover2 on December 08, 2016, 05:57:00 AM
So from what I understand:
Use the Advanced 'Material Type' and:

DIFFUSE (COL_VAR1): In the Diffuse channel.
ALBEDO (COL_VAR2): ?
DISPLACEMENT (DISP): In the Bump channel.
GLOSS (GLOSS): In the Roughness channel.
NORMALS (NRM): In the Bump channel? I'm not sure...
REFLECTION (REFL): In the Specular channel.
AMBIENT OCCLUSION (AO): ?

Someone correct me 8)
Just my two cents.
I use Poliigon textures and don't use all the map
Diffuse OK  > is color map
Albedo > don't use it
Displacement > don't use it
Gloss > in the roughness channel
Normal > in bump channel
Reflection > in Specular (sometimes for metallic textures)
Ambient occlusion > don't use it
That's all

After few testing and searching the web, here is current thought:

Poliigon => KS
=============
COL_VAR1 or 2 => diffuse channel
ALBEDO (same as COL_VAR but with removed shadow or highlight) => not used in KS
DISPLACEMENT (for material with extreme bump height) => not used in KS (I think it is used inside your modelling software)
GLOSS => Roughness channel (btw I never aware of this feature until I found poliigon  :P)
NORMAL => bump channel
REFLECTION => specular channel
AO => not used in KS, maybe for photoshop blending for more depth

Pls correct me if I am wrong.

Bronson

Title: Re: How to use displacement and gloss image from POLIIGON
Post by: bdesign on December 08, 2016, 07:03:09 PM
Displacement maps modify the actual surface geometry, either at render time or as a modeling modifier. As for the POLIIGON displacement maps, I find that they can sometimes create nice enhancements to the larger details when used as a bump map in combination with the normal map via a Bump Add node. Also, from what I've experienced so far, the Bump Height for normal maps from POLIIGON needs to be set to a negative value to give the correct effect, and make sure to check "Normal Map" under the Bump texture properties tab. The AO maps can be multiplied over the Diffuse color or texture via a Color Composite node to enhance details. The attached render has two cubes with a brick texture from POLIIGON. The Diffuse color of both is set to 84% grey. The left one utilizes the displacement and normal maps combined with a Bump Add node, and has the AO map multiplied over the Diffuse color. The right one uses the normal map only, and has no AO map.

Eric
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: TpwUK on December 09, 2016, 01:03:48 AM
AO or Ambient Occlusion is used by KS6

Martin
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: bdesign on December 09, 2016, 01:16:51 AM
Quote from: TpwUK on December 09, 2016, 01:03:48 AM
AO or Ambient Occlusion is used by KS6

Martin
Yes, of course...I was just offering a possible way to utilize the existing AO maps from poliigon :)

Eric
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: TpwUK on December 09, 2016, 02:53:01 AM
Quote from: bdesign on December 09, 2016, 01:16:51 AM
Quote from: TpwUK on December 09, 2016, 01:03:48 AM
AO or Ambient Occlusion is used by KS6

Martin
Yes, of course...I was just offering a possible way to utilize the existing AO maps from poliigon :)

Eric

You must have posted just before me Eric as your post was not present as I started my reply, my response was for Bronson and his request to be corrected where wrong ... Next time I will quote instead :P

Martin
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: bdesign on December 09, 2016, 08:50:30 AM
Quote from: TpwUK on December 09, 2016, 02:53:01 AM
You must have posted just before me Eric as your post was not present as I started my reply, my response was for Bronson and his request to be corrected where wrong ... Next time I will quote instead :P

Martin

Oh...no worries, Martin :)

Cheers,
Eric
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: bronson on December 09, 2016, 04:06:24 PM
Thanks for the very details and in-depth explanations, Eric.
Really appreciate it.  :D

Bronson
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: Will Gibbons on December 13, 2016, 06:13:25 AM
I like the iterative teamwork that's happened in this thread. Nice to see each person sharing their knowledge to fill in gaps. Cheers all!
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: bdesign on December 13, 2016, 11:55:18 AM
The recent enlightening information from Søren concerning the non-linear relationship between gloss and roughness got me wanting to delve futher into this subject. When searching, I came across this great post from 4 years ago by DriesV: https://www.keyshot.com/forum/index.php?topic=4751.0 .
Based on his findings, I opened a new 32-bit document in Photoshop and created a custom gradient in 10% increments, entering the floating point roughness values provided. I then opened a gloss map from Poliigon (Tiles 40_GLOSS_3K) and applied a Gradient Map adjustment layer using the custom gradient, then saved out as a new file. I used this new map in the Roughness channel along with the rest of the Tiles 40 texture map set. To my eye, the resulting render is significantly improved in overall appearance and realism. I'm attaching the custom PS gradient (GlossInversion_GradientMap.grd) for any who wish to give it a try. Place it into your AppData/Roaming/Adobe/Adobe Photoshop/Presets/Gradients folder and load it into the Gradient Editor window when applying the Gradient Map adjustment layer. Thanks again to Søren and Dries for the inspiration to dig deeper into this.

Cheers,
Eric
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: soren on December 13, 2016, 12:09:56 PM
Interesting experiment, Eric.

A further technical point worth noting is that when contrast is 1 on a texture map in KeyShot it corresponds to the source image having gamma = 2. Thus if your texture is in linear space, you should set contrast to zero. This may or may not apply to various images you find (and it is a fairly technical point which can be confusing to find sensible information about), but if you have exr roughness maps for example, set contrast to 0.

Also, you can remap the colors directly in keyshot using the gradient node. Here again, you need to be aware that colors in KeyShot are displayed with the same gamma as set in the Image Tab (by default - can be changed in preferences). Thus a 50% gray defined using a procedural or gradient in the material graph will correspond to a value of 0.25 roughness (if image gamma is 2).

Søren
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: bdesign on December 13, 2016, 12:16:09 PM
Thank you for all your technical input, Søren :) I did try to set this up directly in KeyShot using the Color Gradient node, but found that it would not hold most of the small incremental values (RGB: 0,5,6,8,9,12,15,18,23,31,255), and would set them back to 0%. Do you know of a way to prevent this behaviour?

Cheers,
Eric
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: soren on December 13, 2016, 12:50:19 PM
Just tried it and you are correct - this is definitely a bug. The problem is smaller if you disable "Compensate Gamma" in preferences.

I filed an issue in our bug tracker.
Søren
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: bdesign on December 13, 2016, 01:11:47 PM
Quote from: Søren on December 13, 2016, 12:50:19 PM
Just tried it and you are correct - this is definitely a bug. The problem is smaller if you disable "Compensate Gamma" in preferences.

I filed an issue in our bug tracker.
Søren
Thanks for verifying, Søren.
Quote from: Søren on December 13, 2016, 12:09:56 PM
A further technical point worth noting is that when contrast is 1 on a texture map in KeyShot it corresponds to the source image having gamma = 2. Thus if your texture is in linear space, you should set contrast to zero. This may or may not apply to various images you find (and it is a fairly technical point which can be confusing to find sensible information about), but if you have exr roughness maps for example, set contrast to 0.
So if a texture map is created with gamma 2.2 (which I believe many 8-bit maps are), would it be technically accurate to set the Contrast value to 1.1, if KeyShot is set to the default gamma of 2 under the Image tab? Or, conversely, leave the texture map Contrast at 1, and set KS gamma to 2.2 under the Image tab?

Eric
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: soren on December 13, 2016, 01:13:29 PM
You would set contrast = 1.2 (gamma + 1). The gamma in the Image Tab, incidentally, has nothing to do with this, since it is the gamma of the source file (the texture) - not the output image.

Søren
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: bdesign on December 13, 2016, 01:21:48 PM
Quote from: Søren on December 13, 2016, 01:13:29 PM
You would set contrast = 1.2 (gamma + 1). The gamma in the Image Tab, incidentally, has nothing to do with this, since it is the gamma of the source file (the texture) - not the output image.

Søren
Forgive my confusion, but I'm really interested in this. Contrast 1.2: "Gamma + 1"(?)... 2.2 + 1(?)

Eric
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: soren on December 13, 2016, 01:24:08 PM
sourceGamma = contrast + 1, i.e. contrast = sourceGamma - 1. So sourceGamma = 2.2 implies contrast = 1.2 and sourceGamma = 1 implies contrast = 0.

Søren
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: bdesign on December 13, 2016, 01:25:50 PM
Thanks very much, Søren. I really appreciate all your technical enlightenment.

Eric
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: Will Gibbons on December 20, 2016, 08:31:45 AM
Quote from: bdesign on December 13, 2016, 11:55:18 AM
The recent enlightening information from Søren concerning the non-linear relationship between gloss and roughness got me wanting to delve futher into this subject. When searching, I came across this great post from 4 years ago by DriesV: https://www.keyshot.com/forum/index.php?topic=4751.0 .
Based on his findings, I opened a new 32-bit document in Photoshop and created a custom gradient in 10% increments, entering the floating point roughness values provided. I then opened a gloss map from Poliigon (Tiles 40_GLOSS_3K) and applied a Gradient Map adjustment layer using the custom gradient, then saved out as a new file. I used this new map in the Roughness channel along with the rest of the Tiles 40 texture map set. To my eye, the resulting render is significantly improved in overall appearance and realism. I'm attaching the custom PS gradient (GlossInversion_GradientMap.grd) for any who wish to give it a try. Place it into your AppData/Roaming/Adobe/Adobe Photoshop/Presets/Gradients folder and load it into the Gradient Editor window when applying the Gradient Map adjustment layer. Thanks again to Søren and Dries for the inspiration to dig deeper into this.

Cheers,
Eric

Hi Eric, quick question. How did you arrive at those values for each stop in creating the gradient adjustment layer?

Thanks,
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: bdesign on December 20, 2016, 03:17:11 PM
Quote from: Will Gibbons on December 20, 2016, 08:31:45 AM
Quote from: bdesign on December 13, 2016, 11:55:18 AM
The recent enlightening information from Søren concerning the non-linear relationship between gloss and roughness got me wanting to delve futher into this subject. When searching, I came across this great post from 4 years ago by DriesV: https://www.keyshot.com/forum/index.php?topic=4751.0 .
Based on his findings, I opened a new 32-bit document in Photoshop and created a custom gradient in 10% increments, entering the floating point roughness values provided. I then opened a gloss map from Poliigon (Tiles 40_GLOSS_3K) and applied a Gradient Map adjustment layer using the custom gradient, then saved out as a new file. I used this new map in the Roughness channel along with the rest of the Tiles 40 texture map set. To my eye, the resulting render is significantly improved in overall appearance and realism. I'm attaching the custom PS gradient (GlossInversion_GradientMap.grd) for any who wish to give it a try. Place it into your AppData/Roaming/Adobe/Adobe Photoshop/Presets/Gradients folder and load it into the Gradient Editor window when applying the Gradient Map adjustment layer. Thanks again to Søren and Dries for the inspiration to dig deeper into this.

Cheers,
Eric

Hi Eric, quick question. How did you arrive at those values for each stop in creating the gradient adjustment layer?

Thanks,
Hey Will-
In the old post by Dries that I referenced (reply #4 under this thread: https://www.keyshot.com/forum/index.php?topic=4751.0 ), he presents a chart with paint gloss values from 10%-90%, with the corresponding roughness values in orange. 0% and 100% gloss are assumed to be black and white, respectively. I used the floating point values in orange, with pure white and pure black on each end.

Eric
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: Will Gibbons on December 21, 2016, 06:05:29 AM
That makes sense. So, assuming those values are the ideal ones, each stop in your gradient doesn't need any tweaking, correct?

Thanks,
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: bdesign on December 22, 2016, 12:08:28 AM
Quote from: Will Gibbons on December 21, 2016, 06:05:29 AM
That makes sense. So, assuming those values are the ideal ones, each stop in your gradient doesn't need any tweaking, correct?

Thanks,
Well...that's the way I look at it. This isn't a "scientifically accurate" inversion I'm sure, but I think it's close, and I'm quite happy with the results :)

Eric
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: Will Gibbons on December 22, 2016, 07:26:29 AM
Quote from: bdesign on December 22, 2016, 12:08:28 AM
Quote from: Will Gibbons on December 21, 2016, 06:05:29 AM
That makes sense. So, assuming those values are the ideal ones, each stop in your gradient doesn't need any tweaking, correct?

Thanks,
Well...that's the way I look at it. This is in no way, of course, a scientifically accurate inversion I'm sure, but I'm pretty happy with the results :)

Eric

Understood. Thanks!
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: bdesign on December 22, 2016, 03:04:09 PM
Quote from: Will Gibbons on December 22, 2016, 07:26:29 AM
Understood. Thanks!
Sure thing, Will :)

Cheers,
Eric
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: Esben Oxholm on December 23, 2016, 12:03:10 AM
Interesting thread, guys!
I never thought about the relationship between gloss and roughness not being linear.  ???

Would it be possible in some way to do the gradient conversion with the material graph directly inside KeyShot, to save the additional conversion in Photoshop? I guess not, but I keep being surprised with your solutions, Eric :)
Title: Re: How to use displacement and gloss image from POLIIGON
Post by: soren on January 11, 2017, 06:40:15 AM
For gradient node conversion, see mtl-file posted here https://www.keyshot.com/forum/index.php?topic=13929.0

/Søren