Why has DS always got 3Delight-Specular-Glossiness so badly wrong when importing a Poser pr...

N.B. This question is of mainly historical interest... ;o)
Why has DS always got '3Delight > Specular > Glossiness' so badly wrong when importing a Poser prop/figure ? This has been a minor PITA ever since DS2/3 days. Ages ago I did some empirical wet thumb in the wind approximations and came up with this...
...which I used to create DS mats for anything I produced.
Of course with the focus on iRay (Iray ? Is it de rigeur to get the capitalization correct?) I realize that this is just pissing in the wind... ;o)
...but I find myself wondering nevertheless. Mainly because I'm just doing a new Poser prop and I recall what 'fun' (spelt ''irritation') it was creating 3Delight-specific materials...


P6vDS3Specularity.png
1009 x 521 - 98K
Post edited by 3dcheapskate on
Comments
If it is always the same result, perhaps a DAZ scripter could make a script that applies your findings to the materials. Just a thought. I don't know 3Delight that well, but 3D importing/exporting has always been a PITA to be honest. Programs not fully compliant, or not being able to read certain versions, or some archaic utility you need to use before you can use it. In that regard DAZ Studio isn't doing so bad.
It's dependent on a material's 'NsExponent'. Setting the NsExponent in the material before importing it will give you the correct Spec Glossiness.
I can't find the notes I made with the full range of equivalents, but after checking a couple of files, it looks like NsExponent 60 = Glossiness 70%; NsExponent 40 = Glossiness 80%; NsExponent 5 = Glossiness 100%
The difference here is that when the original DAZ Studio was created it specifically used Poser files. DS didn't have its own DS-native file format (except for .daz scene files and the .dsa, etc scripts - not sure when they came in, DS1, 2, or 3?)
I guess it was just a mistake that was made in the original code, and it never got to the top of the 'fix-it' queue ?
That's defined in an OBJ isn't it ? At least NsExponent rings a bell for OBJs I've exported from Blender. And I know that I always have to fiddle with the Specular/Highlught settings after importing an OBJ from Blender into Poser. But then again, I never bother with Blender material settings, so my NsExponent settings are probably crap to start with !
Maybe that's a case of CICO ? ;o)
Just checked - it's 'Ns' in the OBJ and 'NsExponent' in the PP2. My process The way I usually hack things is (1) create mesh in Blender not bothering about materials, (2) export as OBJ, (3) import OBJ into Poser, (4) set Poser materials, (5) save as PP2, (6) load PP2 in DAZ Studio.
OBJ file - Ns is whatever default value Blender assigned:
PP2 - NsExponent should be set in accordance with whichever PoserSurface parameter it's related to (Highlight_Size?), and I've set all those up to get 'something that sort-of looks right-ish' in Poser:
Edit: by the way, Poser 'Highlight_Size' for this prop is 0.05
I decided to go back to basics - I exported a simple sphere OBJ with a simple MTL from Blender, imported that into Poser (PP2014) and DAZ Studio (a 4.9 beta, the latest I have) using a very basic scene (groundplane plus one infinite light).
Doing so rang (or rather clunked) looks of rusty bells...
I also looked at various explanations of the Wavefront OBJ and MTL files as the OBJs had a 'Ke' that I didn't recall (apparently that's for light emitting materials) and other stuff that I thought I knew what it was but was worth a double-check.
My plan was to simply try comparing Poser/DS renders with one variable changing in the OBJ, Ns=0, 10, 20, ... 90, 100 ... but you know what they say about plans.
Here's what Rob Whisenant told me many years ago when I was asking about .mtl files.
I imagine Ke stands for Emissive.
Thanks, that's useful to know, especially the "..."illum" is not supported by D|S..." . That saves me from chasing red herrings - I'd started wondering whrether that was related to DS 'Lighting Model' (Plastic, Metallic, Glossy Plastic, etc)...
Anyway, here's the MTL for my simple test object, as exported from Blender:
# Blender MTL File: 'BallTest.blend'
# Material Count: 1
newmtl Ball
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 1.000000 1.000000 1.000000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
The best link I found on the MTL file format was http://paulbourke.net/dataformats/mtl/ which seems to be an extract from the specification. From this:
- Ns <exponent>: Specifies the specular exponent for the current material. This defines the focus of the specular highlight. "exponent" is the value for the specular exponent. A high exponent results in a tight, concentrated highlight. Ns values normally range from 0 to 1000.
- Ni <optical_density>: Specifies the optical density for the surface. This is also known as index of refraction. "optical_density" is the value for the optical density. The values can range from 0.001 to 10. A value of 1.0 means that light does not bend as it passes through an object. Increasing the optical_density increases the amount of bending. Glass has an index of refraction of about 1.5. Values of less than 1.0 produce bizarre results and are not recommended.
- d <factor>: Specifies the dissolve for the current material. "factor" is the amount this material dissolves into the background. A factor of 1.0 is fully opaque. This is the default when a new material is created. A factor of 0.0 is fully dissolved (completely transparent). Unlike a real transparent material, the dissolve does not depend upon material thickness nor does it have any spectral character. Dissolve works on all illumination models.
So with Ni=1, d=1, Ke= 0 0 0, and DAZ Studio ignoring 'illum' that leaves me with Ns, Ka, Kd and Ks.
Since I don't want any ambient either I should probably have Ka=0 0 0 as well, leaving just three relevant parameters in the OBJ - Ns, Kd, and Ks.
So I'm going to try using this as the MTL file:
# Blender MTL File: 'BallTest.blend'
# Material Count: 1
newmtl Ball
Ns 90
Ka 0 0 0
Kd 1 1 1
Ks 1 1 1
Looking through my old .pp2 templates, from what I can see, here are some Ns values and DS equivalents
NsExponent 1 = Glossiness 100%
NsExponent 60 = Glossiness 70%
NsExponent 40 = Glossiness 80%
I've just tried some tests imported my OBJ into both Poser and DS. First, here are the PP2014 results for Ns=10, 50, and 90
Ns appears to be used just to set Poser's Highlight_Size (0.1, 0.02, and 0.011111 respectively)
Next the DS results for Ns=10, 50, and 90 (DS4.9.4.117beta - the latest version I have)
Surely I'm doing something really stupid here, because DS seems to be totally ignoring Ns and setting Glossiness=100%
Maybe it's something to do with my hand-edited MTL file, so I re-exported from Blender with two different Kd values just to be sure I was using the correct MTL and set different Ns values.
Same problem - Glossiness set to 100% in both cases.
And it's the same with DS3 (3.1.2.32advanced). No screenshots, but I can do some if anybody really wants to see them.
So much for using an OBJ to set the baseline. I guess that my next step is to save my Balltest props with the different Highlight_Size settings as Poser props, check that the Ns values in them match those of the original OBJs, and see what the Surfaces show me when I import them into DAZ Studio.
They should match up with maclean's figures.
From the MTL spec quoted above - "Ns <exponent>: Specifies the specular exponent for the current material. This defines the focus of the specular highlight. "exponent" is the value for the specular exponent. A high exponent results in a tight, concentrated highlight. Ns values normally range from 0 to 1000."
But it looks to me as if the DS highlight is getting less focussed as Ns increases (i.e. [edited] Glossiness is decreasing instead of increasing) - which would be totally the wrong way round.
I must be doing something stupid, overlooking something, or misinterpreting something, yes ?
Referring back to (1) my graph in the OP, and (2) the three values for Poser's conversion between Ns and Highlight_Size:
Ns Highlight_Size DS Glossiness My graph Glossiness
10 0.1 95% around 70-75%
50 0.02 75% slightly less than 90-95%
90 0.011111 55% around 90-95%. .
So my empirically derived graph also seems to indicate that the Ns-Glossiness relationship [edit] that DS uses when importing a Poser file is the wrong way round...
The graph looks right to me - Glossier surfaces have smaller highlights, duller surfaces have larger, more diffuse highlights (which are almost always weaker - lower Specular Strength).
I use a lot of Poser content with 3DL in DS. Can't comment on the math, not a Poser user, but since I tweak every setting anyway this has not been a big problem, but sometimes irritating for sure;) Yeah 100% glossiness basically means infinite small specular highlights with the DS default shader. I'm used to setting glossiness to 60%, spec color to mid gray and killing the ambience as a starting point:) I think it's important to get used to avoiding pure white and pure black colors for all the color slots, in combination with using a linear workflow ie setting gamma correction on and gamma value to 2.2 in the render settings. FWIW:)
Now I'm even more puzzled ! I created 7 different Balltest OBJ's (OBJ and MTL files in the attached ZIP, just in case anybody wants to double-check what I've done) the only differences being the Ns and Kd values (the Kd purely as a visual cue to which Ns setting the OBJ has:
Ns Kd
0.00 White
0.01 Magenta
0.1 Yellow
1.00 Cyan
10.00 Blue
100.00 Green
1000.00 Red
I imported them all into back into Blender and rendered. This is my baseline. And it seems to match the spec (see earlier post), so it's a good indication of how the specular highlight should look.
I then imported the seven OBJs into PP2014 and rendered. The red, green and blue ones seem more-or-less okay but the others are whiteouts. As Richard said, the Specular Strength should be decreasing as the specular becomes less focussed.
Since DS seems to ignore Ns when importing an OBJ (see earlier post), and because the problem I'm really interested in is DS importing Poser files, I saved the Poser scene, imported that into DS4.9beta, and rendered.
I think I need to go and double-check that the NsExponent and specular strength (the fourth value in the Kd # # # # statement in the PP2/PZ3, as in the earlier example) are as I expect. And also note the DS Glossiness and Specular strength values.
Here are the actual values read from the files, or read from the Poser/DS UIs:
Ns in OBJ Kd in OBJ Poser Highlight_Size NsExponent in PZ3 DS4.9 Glossiness
0.00 White 100.0 0.00 100.0
0.01 Magenta 100.0 0.01 100.0
0.1 Yellow 10.0 0.10 99.95
1.00 Cyan 1.0 1.00 99.5
10.00 Blue 0.1 10.00 95.0
100.00 Green 0.01 100.00 50.0
1000.00 Red 0.007813 128.00 50.0
(Note: the value highlighted in blue appears to be due to limiting in Poser)
That bit from the spec regarding Ns again - "...A high exponent results in a tight, concentrated highlight..."
So the red and green balls (NsExponent values of 128 and 100 respectively in the PZ3, DS 'Glossiness' of 50%) should have the tightest, most concentrated highlights, while the white and magenta balls (NsExponent of 0.00 and 0.01 0 respectively in the PZ3, DS 'Glossiness' of 100%) should have the least focussed highlights.
To me the highlights on the red and green balls in the DS render do actually look more focussed than the other balls (although nowhere near as focussed as I'd expect from the Blender render). That's why I'm puzzled again.
For a laugh I tried halving the specular strength for each ball (red=1.0, green=0.5, blue=0.25, etc) in Poser and saving that to a new PZ3. Here's that one rendered in both PP2014 and DS4.9
...and I also tried reversing the order of the balls in DS4.9:

Simply importing the first PZ3 with the seven balls (ti.e. the one mentioned in this post) into DS4.9 and changing the Diffuse Colour to mid-grey. The two on the left look near enough identical (no surprise with NsExponents of 128 and 100), the next (NsExponent=10) seems to have a pinpoint highlight, and all the rest seem to be unfocussed in exactly the same way.
...and orbiting the camra about 90 degrees:
Of course, it's not until I try different 'Lighting Model' settings that I remember that DS has converted the IBL of my Poser PZ3 to a distant light, so I have 2 distant lights, same azimuth but 0 and +45 degrees elevation, which blurs things a bit more, especially with the non-glossy palastic/metallic lighting models
Now I remember why I used the Glossy Plastic and Glossy Metallic lighting models for the graph in the OP...
(Note: you'll have to click the thumbnails to view the rest of the lighting models - they have the lighting model in the name)
Plastic

Glossy Plastic



I always thought that DS 3Delight 'Glossiness' seemed to be the wrong way round.. I'd expect Glossiness=100% to be a shiny, polished type surface (which would correspond to a high NsExponent value, and give a tight,concentrated highlight). And I'd expect Glossiness=0% to be a dull, matte type surface (which would correspond to a low NsExponent value, and give a wide, unfocussed highlight - probably no highlight at all).
But looking at the 5x5 grey balls tests in the previous posts it appears that the tightest,most concentrated highlight occurs around Glossiness=50
I really can't make head or tail of this...
Just keep in mind that you are talking about one shader (DS default), which is far from physically accurate or even plausible;) Use your eyes, not math, that's my 2cents. But as I mentioned and you know, glossiness of 100 means an infinite small, therefore almost invisible highlight. One shouldn't really separate specular highlights from raytraced reflections, right?
The DS Default shader is the only one I ever really used, and it always seemed 'plausible' enough for me back in those days. But I guess that in these PBR days 'plausible' ain't what it used to be !
Lol I've noticed that also;) DS default is pretty robust, you know what you get.