Author Topic: Should diffuse texture always be an .exr?  (Read 7913 times)

2016-10-04, 20:32:45

Jadefox

  • Primary Certified Instructor
  • Active Users
  • ***
  • Posts: 251
    • View Profile
    • Renderlab
Hi Guys.

From what I understand and read the diffuse texture can't be linear or " render correct" if it,is in 8 bit.or 16 bit( png or jpg) as this is not considered linear.
In effect all diffuse textures should be saved as 32 bit .exr's before slotting them into.the diffuse?
Do I have this right?

2016-10-04, 21:46:03
Reply #1

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile
Do not worry about this - All modern renderers and DCC apps (which 3ds Max is since 2014) automatically convert the input textures into linear color space - so there is no difference between using EXR and JPG in this regard ;).

Also number of bits does not imply whether the format is linear or not - for example EXR is saved linearly, and can use 16 bit color depth ;)
Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)

2016-10-04, 22:24:45
Reply #2

Juraj

  • Active Users
  • **
  • Posts: 4816
    • View Profile
    • studio website
Man, I am starting to worry what are you in reading :- ) You periodically post some odd conclusions. Where did this one come from ?

Some textures benefit from higher bit-depth ( 16-32bit per channel) because it contains more information of tonal gradient. 8bit is only 255 steps.
16bit .png or 16/32bit .exr both contain enough capacity to store much more information, so they're preferred formats for displacement for example, where 255steps would cause...well, stepping :- ). Like Minecraft voxels.

16bit .png is by default 2.2 gamma, 16/32bit .exr is linear/1.0 gamma. This is how they are referred, but you can still use 2.2 format and tell the renderer to interpret it as linear (in 3dsMax you do this with "override gamma" with opening dialog).

We specify some textures to be interpreted linearly because we want the values to directly translate without any curve to it, input to match output. Let's say we use displacement modifier specified to use 0.5 as middle and 20 cm height. With linear texture, RGB 128 is going to stay as is, RGB 0 will move 10 cm down, and RGB 255 with move 10 cm up. If it was gamma 2.2, RGB 186 would be middle point, so the texture would move more down then up.
Textures this applies to commonly are reflection map, glossiness/roughness map, normal map, anisotropy map, Fresnel IOR map, bump&normal&displacement. This isn't actually necessary per-se, we can use them as gamma, we'll just get different values, which in case of glossiness or bump will not even matter, but normal maps will go totally wrong.
One big reason why this is often trouble in workflow, is that 3dsMax isn't nearly smart enough to know when to use which. Auto-gamma correctly detects gamma 2.2 formats like jpegs/png/tif... to be 2.2 and linear files like .hdr/.exr to be 1.0. It doesn't know we want every format to be read as linear if we place it as normal map. So we have to override it manually.

Some softwares like Unreal 4 already made themselves smart enough to always interpret normal maps as 1.0, regardless of format it's stored :- ).

And as Ondra said, every texture is in fact linearized by renderer in background, whether it's interpreted as 1.0 or 2.2. We don't need to linearize anything by ourselves.

Bit-depth and gamma are different, non-conflated things. 32bit in CGI use just happens to be linear (gamma 1.0) and floating point (fractional numbers), but it could just as well be Integer and store values on gamma curve.
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!

2016-10-04, 22:52:35
Reply #3

Jadefox

  • Primary Certified Instructor
  • Active Users
  • ***
  • Posts: 251
    • View Profile
    • Renderlab
Man, I am starting to worry what are you in reading :- )
hahaha I read up so much its really becoming an unhealthy obsession : )

This article I read here http://therenderblog.com/how-to-linearize-textures-in-photoshop/
and I thought it correct in that you guys always say that the diffuse is a lot darker than what we
take it for. With this tutorial it kinda made sense as his conversion darkended the diffuse
but oh alas barking up the wrong secret tree again. Its just that there is so much confusing around this
by vetererans even in the industry. Back to the drawing board

2016-10-04, 23:05:01
Reply #4

Juraj

  • Active Users
  • **
  • Posts: 4816
    • View Profile
    • studio website
Man, I am starting to worry what are you in reading :- )
hahaha I read up so much its really becoming an unhealthy obsession : )

This article I read here http://therenderblog.com/how-to-linearize-textures-in-photoshop/
and I thought it correct in that you guys always say that the diffuse is a lot darker than what we
take it for. With this tutorial it kinda made sense as his conversion darkended the diffuse
but oh alas barking up the wrong secret tree again. Its just that there is so much confusing around this
by vetererans even in the industry. Back to the drawing board


Quote

therenderblog Mod  Manuel Reyes • 2 years ago
Hi Manuel, this workflow is just for renders like mental ray that doesnt have a linear workflow by default

I think he's talking about MentalRay in old Maya maybe ? Because 3dsMax had linear workflow (ever wondered why it's called "linear workflow" when it could just as well be called "gamma workflow" :- ) ? ) for so long as far I know.

Not sure which release of Maya it was (2015 ?), but now Maya has even more complex color management than 3dsMax with brutally robust texture interpretation ( you can specify not only gamma, but full color-space profiles like Photoshop, so you specify scene-linear Rec 709/sRGB, Arri LogC, ACES profiles,)
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!

2016-10-04, 23:08:24
Reply #5

Juraj

  • Active Users
  • **
  • Posts: 4816
    • View Profile
    • studio website
Its just that there is so much confusing around this
by vetererans even in the industry. Back to the drawing board

Listening to veterans is not often that sound, lot of them don't really keep up to date with technological progress and bring a lot of baggage from old times. Often they still use ancient hacks like loading textures with inverse gamma ( as 0.454),
not even remembering why they do it (or they never really knew).
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!

2016-10-04, 23:22:39
Reply #6

Jadefox

  • Primary Certified Instructor
  • Active Users
  • ***
  • Posts: 251
    • View Profile
    • Renderlab
"Loading textures with inverse gamma ( as 0.454)"
Lol , I was at that for a long stage after my infamous readings.
As to the above blog post I just though the whole gamma issue applies to
all formats and will have some application here.

Can I try one last time ?

any image irrespective of bit depth captured by a camera would be in effect a dark contrasted image
To view this on any electronic device a correction curve of 2.2. is applied
Case and example lets take arrow-way wood 74 , can I slot that diffuse texture straight to my diffuse slot or...
is there some color correction applicable before Max and Corona can accurately apply their math to make texture look real.
The textures I am referring to is not self personally photographed , so lets not apply Dubcat's complexities :)

Juraj, me dear friend, you have a corona material  chair in front of you that needs to be wrapped in Arroway wood texture 74

Do you take that texture in its native form and applied it, or do you always precede your diffuse texture with a color correction node and why ?

If I humbly may ask the above


2016-10-04, 23:35:41
Reply #7

Juraj

  • Active Users
  • **
  • Posts: 4816
    • View Profile
    • studio website
You load it directly :- ). No CC, no gamma, no nothing.

Here are wood shaders which loads all maps as jpegs, and as 2.2.

Even bump map and glossy. Why ? Because the bump is random B&W contrast, it's not supposed to be some exact value, it only needs to create some microscopic detail.
The glossy is also just loaded as default (2.2), because it's just random B&W highpass to make some kind of detail within reflection.

But if I created glossy map which wanted to simulate 0.5 glossiness value exactly, and I painted it with 128 RGB middle grey, then I would need to load that texture as 1.0 gamma for 128RGB to match 0.5 (128RGB). Regardless of bit-depth. Or file format.
If I created a normal map (like in Quixel DDO), that would have to be loaded as 1.0 (override if jpeg, and automatically if .exr), because those gradients that make normal map work require it.
« Last Edit: 2016-10-04, 23:42:03 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!

2016-10-05, 08:03:46
Reply #8

Jadefox

  • Primary Certified Instructor
  • Active Users
  • ***
  • Posts: 251
    • View Profile
    • Renderlab
Thanks so much! It's settled then, my workflow then as you describe above.