Approaching Realism in DAZ Studio and Gamma Correction Demystified

123578

Comments

  • mjc1016mjc1016 Posts: 15,001
    edited December 1969

    Hypothetically, if one wanted to do their own gamma correction on images before passing them to the render engine, how would you do that?

    And correct me if I am wrong here, if I was to correct my textures by hand, I would then leave GC off in render settings and leave the gamma value at 1.

    Hit me.

    Only if you are sure you got them all...and you calibrate your monitor...and you set all your image editors/use only ones that can be set up not to adjust...resave everything in a format that 1) doesn't auto-correct and 2) DS can natively use...then you might be able to get away with it.

    That's basically what they do in big F/X houses and such. And unlike the big studios/F/X houses, you are somewhat limited in your choices of file formats...probably tif and exr (and no, an exr image doesn't HAVE to have a high dynamic range...it's just capable of it)...basically a 32 bit floating point format.

    Or to put it another way, since the vast majority of the content is not linear, it would take a hell of a lot of work to be able to go pure linear.

  • evilded777evilded777 Posts: 2,339
    edited December 1969

    I really only ask because there is this "discussion" going on over in the Iray threads about "gamma adjusting" textures, and I think they are way off base in what they are doing and relating what they are doing to the process of gamma correction. And while I understand gamma correction, I don't know enough to explain the difference.

    If I were to take a texture into Photoshop and manually apply a gamma of 2.2... what am I doing? I am most certainly not creating a linear input... right?

  • Richard HaseltineRichard Haseltine Posts: 66,023
    edited December 1969

    You'd need an inverse gamma of 2.2, otherwise you are compounding, but I assume that's a typo. Dragging the curve down should give a gamma 1 image, as I understand it, but as mjc says you'd then have to set the image to use gamma 1 and of course it would look weird as an image map. You'd also degrade the image if you saved it in an 8 bit per channel format, as you'd have an equal number of colours before and after the anti-correction but you'd have moved them around a bit, so there would be gaps at the top end of the histogram and doubling up at the bottom (which you shouldn't, I think, get correcting in DS as the renderers use higher precision internally).

  • evilded777evilded777 Posts: 2,339
    edited December 1969

    Thanks, Richard.

    All stuff I was unable to really put into words due to my frustration at people spreading inconsistent and incorrect information and others snapping it up and running with it.

    I'm going to leave this topic alone, because I can't seem to summon any rationality on it.

  • kitakoredazkitakoredaz Posts: 3,526
    edited December 1969
  • Mustakettu85Mustakettu85 Posts: 2,711
    edited December 1969

    Hypothetically, if one wanted to do their own gamma correction on images before passing them to the render engine, how would you do that?
    And correct me if I am wrong here, if I was to correct my textures by hand, I would then leave GC off in render settings and leave the gamma value at 1.

    The final value would be 2.2. And 0.45 on the colour maps in an image editor. Makes them dark.

    The guys have already explained a lot about the issues there may arise, but I actually did manual degamma in my last days of using DS3. This is what actually pushed me to embrace the 4.x builds =)
    And even with the fidelity loss (because I was saving to 8bit), the result still looked so much better than just doing the incorrect thing.

  • SzarkSzark Posts: 10,633
    edited December 1969

    I have never bought a product that the surfaces didn't need tweaking. Just because the surfaces are set up for 3delight doesn't make them good for my light set ups. Yes Iray is a little different as in if the surfaces are set up correctly they should render correctly in any lighting situation.

  • mjc1016mjc1016 Posts: 15,001
    edited December 1969

    Szark said:
    I have never bought a product that the surfaces didn't need tweaking. Just because the surfaces are set up for 3delight doesn't make them good for my light set ups. Yes Iray is a little different as in if the surfaces are set up correctly they should render correctly in any lighting situation.

    No, Iray isn't that different...it's just that it is pretty much meant to work with a linear workflow. Feed it non-linear stuff and you get the same lighting vs texture problems. Actually, it can be potentially worse, because it is relying on pure math and physics without the 'fudge factors' inherent in a biased/non-PBR renderer. At best you end up with something that is close, like the silicon 'rubber' stuff used for high end masks as opposed to skin....while at worst you end up with something that isn't even able to be made in a lab somewhere and left wondering why your results are so inconsistent.

    The surfaces, if they are linear, regardless of which renderer (Luxrender, Octane, Iray, 3Delight, Cycles or POV-Ray...did I leave out any that can handle Studio stuff/have an exporter?) should just 'work' in any light. The tweaks done should be for effect, not correcting problems.

    All the PBR materials assume one thing...linear workflow. The newer features in 3Delight also make that assumption. The 'physically plausible' materials and shaders, like PBR materials require linear inputs. Even the 'old school' 3DL shaders worked best with linear inputs.

  • JimbowJimbow Posts: 556
    edited April 2015

    I really only ask because there is this "discussion" going on over in the Iray threads about "gamma adjusting" textures, and I think they are way off base in what they are doing and relating what they are doing to the process of gamma correction. And while I understand gamma correction, I don't know enough to explain the difference.

    If I were to take a texture into Photoshop and manually apply a gamma of 2.2... what am I doing? I am most certainly not creating a linear input... right?

    I think I need to explain why I'm doing it ;) When I apply a Photoshop gamma correction of 2.2 to normal, bump and opacity maps, they work correctly in Daz-iray. There have been many complaints about hair opacity maps looking thin, etc, and the solution is to corrrect to 2.2, after which they work just fine and exactly as expected. This tells me that the Daz>iray implementation isn't finished (it's a Beta), and textures of all stripes aren't being modified for rendering when you hit the render button. In all of my (many) years doing 3D I've never come across a renderer that requires rgb and scalar/vector maps to be handled differently in colour space. WYSIWYG is the usual rule. Also, I believe the lighting is just more accurate once I render at gamma 1, but my textures were looking crushed. The exception is .hdr environment maps, but then they come into Photoshop differently to exr's anyway and a different proof setup is needed to view exr's as linear. The best way to render .exr's in Daz-iray is to switch off tonemapping, which forces the renderer to render linear (as advised by Daz here on these forums when they told us how to output .exr using the canvasses), and tonemap/colour correct later. I hope that clarifies why I've gone down the path I have.

    I'm also fully aware that I'm losing detail in the maps, but, to be honest, I'm no longer using diffuse maps and have converted them to albedo maps, so there actually isn't much range of tonal detail in the colour maps anyway, as they represent pigment, not ersatz lighting. I also have a backup of the linear originals, and wouldn't be at all surprised that once the final version of Iradium is released, all I'll have to do is swap the directory names and I'll be back to using the linear maps.

    I hope that clears things up ;)

    Post edited by Jimbow on
  • ZarconDeeGrissomZarconDeeGrissom Posts: 5,382
    edited April 2015

    I understand the confusion with 2.2 vs 0.45 Gamma adjustment, as some websites only show one curve for everything, rather then the inverse curve to describe what's going on, lol.

    I'm still not sure the attached screen-cap, has the correct curves on the input, as it is more often shown on the output as that for some things.

    An equally puzzling thing with hard-coding gamma into the RGB values of an image, is you end up with more values at one end then the other of mid-gray. That is why I think most computer stuff has traditionally had that gamma thing to begin with. Who wants a photo that has 192 shades of white, and only 64 shades of dark. Shadows would naturally start to look rather bad.

    Also, the light fall-off behavior is quite different in 3delight when using Gamma Correction settings, so the results can be drastically different in scenes with depth to them.

    FromCamera_toFile_ToDisplay_001.png
    1075 x 904 - 211K
    Post edited by ZarconDeeGrissom on
  • JimbowJimbow Posts: 556
    edited December 1969

    I don't think it's an issue of LUT or even what's the right gamma at this stage, it's just that when opacity textures can only work as they're supposed to with a prior gamma correction in an image editor, then it's best to wait for the final release. I doubt MAX users have anything like this discussion when they're using iray.

  • mjc1016mjc1016 Posts: 15,001
    edited December 1969

    Jimbow said:
    I don't think it's an issue of LUT or even what's the right gamma at this stage, it's just that when opacity textures can only work as they're supposed to with a prior gamma correction in an image editor, then it's best to wait for the final release. I doubt MAX users have anything like this discussion when they're using iray.

    I doubt that Max users are using textures of such varied origin, to begin with...

    Most MAX users I know consider premade textures the same way a French baker considers plastic wrapped, sliced white bread.

  • JimbowJimbow Posts: 556
    edited December 1969

    mjc1016 said:
    Jimbow said:
    I don't think it's an issue of LUT or even what's the right gamma at this stage, it's just that when opacity textures can only work as they're supposed to with a prior gamma correction in an image editor, then it's best to wait for the final release. I doubt MAX users have anything like this discussion when they're using iray.

    I doubt that Max users are using textures of such varied origin, to begin with...

    Most MAX users I know consider premade textures the same way a French baker considers plastic wrapped, sliced white bread.

    You need to tell Turbosquid that :)

  • prixatprixat Posts: 1,203
    edited December 1969

    I'm still not sure the attached screen-cap, has the correct curves on the input, as it is more often shown on the output as that for some things.

    I'm not sure why it shows a de-gamma on input. Perhaps its just to demonstrate that an unexpected 'linearisation' is what causes the "washed out" image.

    ...Who wants a photo that has 192 shades of white, and only 64 shades of dark.

    If you reverse that sentence: "Who wants a photo that has 192 shades of dark, and only 64 shades of white?" the answer is, humans beings! :-)

    Did you notice the gamma=1 operation on output? Is that what you were asking about with the screen-cap of your MS Paint output you posted earlier?

  • Mustakettu85Mustakettu85 Posts: 2,711
    edited December 1969

    mjc1016 said:

    The surfaces, if they are linear, regardless of which renderer (Luxrender, Octane, Iray, 3Delight, Cycles or POV-Ray...did I leave out any that can handle Studio stuff/have an exporter?) should just 'work' in any light. The tweaks done should be for effect, not correcting problems.

    I feel compelled to add that, as in real world, there are "film ISO values" to be taken into account as regards lighting.
    This is what the "gain" setting is for: if your lights are too low (but you have set them up logically, for instance, for a copy of a real world room), up the gain. Conversely, lower it if there is too much light. Gain is a linear adjustment, unlike gamma.

  • mjc1016mjc1016 Posts: 15,001
    edited December 1969

    mjc1016 said:

    The surfaces, if they are linear, regardless of which renderer (Luxrender, Octane, Iray, 3Delight, Cycles or POV-Ray...did I leave out any that can handle Studio stuff/have an exporter?) should just 'work' in any light. The tweaks done should be for effect, not correcting problems.

    I feel compelled to add that, as in real world, there are "film ISO values" to be taken into account as regards lighting.
    This is what the "gain" setting is for: if your lights are too low (but you have set them up logically, for instance, for a copy of a real world room), up the gain. Conversely, lower it if there is too much light. Gain is a linear adjustment, unlike gamma.

    The more I think about, the more convinced I am that the best way to learn how to set up a render, in a linear environment/PBR, is to take a digital camera, turn OFF all the automatic features and spend a couple of weeks taking pictures, of everything and everywhere you go...

  • evilded777evilded777 Posts: 2,339
    edited December 1969

    Awesome mcj, I've learned more about rendering from my camera and more about my camera from rendering.

  • evilded777evilded777 Posts: 2,339
    edited April 2015

    Huge difference between my two monitors.

    Did my levels adjustment on my main monitor, looks pretty good. On my secondary monitor... ehh. Kinda washed out.

    This is Macro Skin rendered without GC.

    Suggestion for monitor calibration? I used Calibrize... to little effect.

    HeroineSig.png
    989 x 1600 - 2M
    Post edited by evilded777 on
  • evilded777evilded777 Posts: 2,339
    edited December 1969

    And why does it she look great in the render window, but then I save and open in PhotoShop and wow... that looks un-GC, now!

  • jpb06tjpb06t Posts: 272
    edited December 1969

    The histogram of the original image (note the large amount of bright levels unused)

    histo.jpg
    446 x 751 - 71K
  • jpb06tjpb06t Posts: 272
    edited December 1969

    And the image with the brightness range fixed.

    HeroineSig2.jpg
    989 x 1600 - 241K
  • evilded777evilded777 Posts: 2,339
    edited December 1969

    latego said:
    The histogram of the original image (note the large amount of bright levels unused)

    I don't know how much of that is due to my adjustments. I don't normally have to make what I feel are such large corrections, so I don't really know what I'm doing. And it looked a lot better, on my main monitor than the end result.

  • Mustakettu85Mustakettu85 Posts: 2,711
    edited December 1969

    mjc1016 said:

    The more I think about, the more convinced I am that the best way to learn how to set up a render, in a linear environment/PBR, is to take a digital camera, turn OFF all the automatic features and spend a couple of weeks taking pictures, of everything and everywhere you go...

    My grandfather's hobby was photography. He never let anyone use his cameras, but he allowed us to read any of his numerous photography books. I used to be next to literally glued to a cheap camera as a teenager; it was in the 90s, so naturally it was not even digital but film (took me quite some time to realise I would never make a decent photographer - I don't have the "eye"). Naturally it had no user-friendly presets, so yup, I did have to learn something. Setting up some very punk rock homebrewn softboxes included =)

    I am thankful for that experience, these days.

    ----------

    And why does it she look great in the render window, but then I save and open in PhotoShop and wow... that looks un-GC, now!

    Photoshop is known to have some internal colour management going on behind the scenes. I have read about it causing issues. Unfortunately I have never used PS, so I cannot suggest any workarounds. I think there must be an option that needs disabling.

    As for monitor calibration, I use QuickGamma. It's not as reliable as using a hardware calibrator, but I have been able to get consistent results across the range of machines I have access to.
    http://www.quickgamma.de/indexen.html

  • ZarconDeeGrissomZarconDeeGrissom Posts: 5,382
    edited December 1969

    prixat said:
    I'm still not sure the attached screen-cap, has the correct curves on the input, as it is more often shown on the output as that for some things.

    I'm not sure why it shows a de-gamma on input. Perhaps its just to demonstrate that an unexpected 'linearisation' is what causes the "washed out" image.

    ...Who wants a photo that has 192 shades of white, and only 64 shades of dark.

    If you reverse that sentence: "Who wants a photo that has 192 shades of dark, and only 64 shades of white?" the answer is, humans beings! :-)

    Did you notice the gamma=1 operation on output? Is that what you were asking about with the screen-cap of your MS Paint output you posted earlier?Sorry for the delay, been buisy. I was referring to the direction of the sown curve, upward hill for 0.45 and down Vally for 2.2, as apposed to all the other places that show an upward hill as representing a 2.2 curve. The input there is what a camera or scanner is doing to the light to make the Perceived brightness liner values of sRGB. leading to the next point regarding the number of represented values in a file.

    With mid gray some where other then 127.5 in a 24bit sRGB file, there are less numbers at one end or the other to represent that part of the scale. (Not everything can use 384bit floating-point color value image file, JPG, gif, bmp, etc. lol).

  • prixatprixat Posts: 1,203
    edited April 2015

    I'm not sure which images you've seen but downward for gamma 2.2 is correct.

    That 'corrective' curve is correct. :-)
    Think of it as 'what shape do I need to apply to gamma 2.2 image to return it the straight diagonal?'

    The whole point of applying gamma is to 'make more levels' available in the shadows and 'sacrifice some levels' in the highlights. :coolsmile:

    Post edited by prixat on
  • evilded777evilded777 Posts: 2,339
    edited December 1969

    Bit of sidetracking here, but I figure you folks would be the best to contribute.

    My current monitor, actually an old LCD TV, is really starting to let me down. It will not retain the settings I choose while meticulously trying to gamma correct it.

    So I am in the market for a new monitor. What should I be looking for, as someone who spends most of his time in 3D apps and games?

    Looking at an LG Ultra Wide Screen for the real estate, but I don't know.

    http://www.bestbuy.com/site/lg-29-ips-led-hd-219-ultrawide-monitor-black/9222018.p?id=1219399592125&skuId=9222018

  • kitakoredazkitakoredaz Posts: 3,526
    edited May 2015

    Hi sorry interrupted suddenly, but I think here is the topic to ask about DS gammma correction way.

    I feel I almost understand why we need gamma correction etc, (if I hope to ciruclate correctly each texture color)

    when I set gamma correction "on" and ds guess (other user use "guess")
    which texture need to change gamma for liniea render., and somecase (shader etc)
    ds can not guess correctly. then not change the image gamma or miss apply gamma.

    it depend on how shader property are named or labbeled as default way, (I guess so ^^;)

    but the problem is, what ds guess and what did, when I see "0.0" value in ds surface tab >image editor "gamma" value.

    I have not much interesting, how ds guess, but simply to know clear, after ds gess, what ds did for the image.

    case1 (I hope so)
    the gamma 0.0 in image editor, means, about the image,
    Anyway, ds change gamma (apply pow ( (R,G,B) /255 , 2.2) about image gamma saved in PC?
    I believed so. that means, 0.0 = 2.2


    case 2
    the gamma 0.0 in image editor
    ds guess, then ds apply gamma for color data (ds guess ,it is color data),
    but not apply gamma for non color data (ds guess, it is not color data, then not apply gamma)?

    eg,, if the texture for used opacity, or bamp etc,, in image editor, gamma value was 0.0 ,
    means,, ds "guess" and "maybe" treat it as non color data, then not apply gamma?
    but if ds treat it as color data, then apply gamma? (ds miss guess)
    (or we could not see, which , ds apply gamma or not?)

    so to speak,,, 0.0 means it is sign, DS could guess? if so,, user can not see, ds apply gamma 2.2 or not?
    then 1.0 means DS could not guess which, so that, do not tocuch it = not apply gamma then 1.0 ?

    =====================================
    I know it seems better to ask daz progurammers,
    but before I asked about gamma in image editor, in help center,
    they said t"he question is out of boundary which they can help,then suggest me to ask and check in forum.

    so that I really hope somewone simply teach me clear, the 0.0 means what forumula ds did.
    I just hope to know it.

    Post edited by kitakoredaz on
  • nDelphinDelphi Posts: 1,825
    edited May 2015


    Regrettably, I still can't use it personally - one method excludes my using a number of shaders I need,

    Number of shaders aside, this has been one of my issues with Gamma Correction in DAZ Studio. In my scenes there's always way too much to do to get textures to not look too bright and flat with Gamma Correction on even when lowering the lighting. And products that use their own shaders are also a problem; for example, the Ranger hair for Genesis 2 Female.

    I use Gamma Correction in other renderers, like LuxRender. If I need Gamma Correction for a DAZ Studio/3Delight render I just use Photoshop on the image.

    Post edited by nDelphi on
  • jpb06tjpb06t Posts: 272
    edited December 1969

    For those still thinking that linear workflow is pointless "techiness", I suggest watching this short NVIDIA video about what you can do with Iray light path expressions, provided that you stuck with a linear workflow.

  • ParrisParris Posts: 389
    edited May 2015

    so that I really hope someone simply teach me clear, the 0.0 means what formula ds did.
    I just hope to know it.

    Thank you kitakoredaz for asking this question. Basically, a lot of us have been speculating as to how DAZ Studio determines what value to apply to image inputs by default - in Surface Tab > parameter (Diffuse for instance) > image icon > Image Editor... > Image Gamma. When no value is specified in a preset, DS defaults to "0.00", which means DS makes it's best guess as to the correct anti-gamma value to apply. But "how does it guess?", that is what kitakoredaz asked and the answer can benefit us all.

    My contact at DAZ was kind enough to get me the answer today: If the surface doesn't have gamma defined in the preset that loaded it, DS uses file extension to guess. PNGs get 2.2. JPG, JPEG, JPE, TGA, BMP, TIF, TIFF all get assigned sRGB (which for our purposes is basically the same as 2.2). DS does not currently have a way to auto-detect control maps, so it just assumes that any of the above formats has a Gamma of 2.2. Therefore, we need to set control maps to 1.0 (no correction) to get the correct results. Setting color inputs to 2.2 ,as I originally suggested is for the most part an unnecessary step. So, if you see values set to anything but 0, it means that the vendor or PA has specified that value when they created the preset.

    I hope that helps folks. It has definitely cleared some stuff up for me!

    Post edited by Parris on
Sign In or Register to comment.