Announcement

Collapse
No announcement yet.

Linear workflow setup

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Linear workflow setup

    Hi,

    I would like to confirm something that seems correct just by looking at the result but I have no knowledge of the exporter settings.

    I usually use:

    Color mapping tab
    Gamma 2.0
    Input gamma 1.0
    linear workflow: on

    Hdmi Texture (linear hdr)
    Input color space:linear
    Bitmap/color space: linear

    A difuse jpg texture on vray material
    Input color space: srgb
    Bitmap/color space: Gamma corrected

    My doubts:
    I don't understand the difference beween "linear" and "gamma corrected" on bitmap / color space selector.
    At the same time linear workflow seems to change only the colors of the materials made on blender...And sometimes I think I have more correct exposures with this setting off. Isn't it making doble gamma correction to this colors?

    Can anyone put some scientific light on the subject?

    Thanks in advance.
    Arquitecto is just a very nice architect in Portugal ...

  • #2
    Re: Linear workflow setup

    Hi there,

    I loved your work on yafaray forums btw (if you're the same person). I spent quite some time on the spot3d (vray manuals) site trying to work this out, and it got very confusing.

    The following is what I found by searching and speaking to colleagues and I'd be happy to be corrected, if wrong.

    First of all, linear workflow checkbox is basically a way of fixing older scenes before colour management settings in 3d software. . I have never found it useful and leave it off. This would generally mess up blender's colour inputs as blender's interface handles the display / conversion of display colours to linear colours for VRay. Your settings might work OK for textures as linear workflow will correct the textures instead of input gamma, but it will double correct the blender colour pallette colours (I think).

    Second, gamma is a correction which takes into account the response of computer monitors. Jpeg images generally have a gamma of 2.2. The gamma is mathematically defined as x=y^2.2, which plotted on a graph gives the gamma 'curve'. This defines the relationship with real life illumination and computer screen brightness. The curve illustrates that the high and low (like and dark) values are squashed into the top and bottom of the curve, which is hy when you try to brighten a dark image too much, you get a posterised/banding effect. This might not be the most scientific explanations, but the fact is thatJPEG textures need to have their gamma correction reversed for the pixel values to relate to real world illumination] and react correctly with GI, shadows, lighting etc within the render engine. All images with gamma e.g. LDR jpegs, need to have the gamma removed, and to make it easier, there is a 'global' input gamma value, which is default when a texture is added and gamma correction is selected as in Textures>Bitmap>ColorSpace . This converts an image with gamma to a 'linear' (x=y if you plotted on graph) image, which corresponds to real life lighting for use in the render engine.

    Finally, when you view an image on your screen, you image needs to have gamma correction adding to it, as you will be viewing it on a screen. In colour settings, this is the 'gamma' value should be 2.2 for an sRGB screen (all modern screens are this, mac used to be 1.8, but they changed to match sRGB).


    EDIT: This section has been corrected, the screen grab below is slightly wrong - input gamma should change, see posts below!
    Summary
    Linear workflow should generally be OFF. Blender's colours work properly (as long as you don't tick 'linear workflow')
    Gamma needs removing from most jpegs, either by using gamma correction (as inverse of gamma in image) or by selecting sRGB.
    Linear HDRi maps / textures don't need gamma correction as they are 'linear'.
    The global input gamma value should be .4545 if you are removing gamma 2.2 from textures (though in most cases, sRGB textures are used, use the preset for this).
    The (output) 'Gamma' should be 2.2, to put the required correction into the image for display on your monitor.
    Using the above settings, textures in the final image look almost the same as they do when they do before they go in. Colours selected in the colour palette also render the same into the final image.

    [attachment=0:2h81652d]coloursettings.jpg[/attachment:2h81652d]

    One additional note: If you are outputting exr files, the output gamma can be 1.0. When loaded into compositor or PS / lightroom, the gamma can be added here, not 'baked' into the exr file.

    Hope this helps.

    Rob

    PS - If I've got any of this wrong - please correct me!
    Attached Files

    Comment


    • #3
      Re: Linear workflow setup

      Hi ockelford,

      Thank you for your kind comments. Yes I have worked with yafaray a lot and I have published some works I really enjoyed.
      I would like to promote the vray blender workflow now since it is a kind of underdog too.
      Andrey has made a huge work that deserves more attention.

      Your explanation was very clear and details and supports some assumptions I made just by looking.
      It's good to know that there are reasons for linear workflow beeing off and the correct general gamma workflow.

      Maybe I was not very clear, but you forgot my question about the simple difuse jpg texture on a vray material:
      "Input color space": srgb
      "Bitmap/color space": Gamma corrected
      Should we have this setting on that texture?
      Why this two settings and not just one? (we have one setting for the texture imput and the other for the texture on the render engine. Why?)

      P.S.: As soon as posible I will publish some nice works (I hope) to promote vrayblender and this magnificent work. Meanwhile I discover this post that has a different approach that states diferent info about input gamma viewtopic.php?f=23&t=284
      Arquitecto is just a very nice architect in Portugal ...

      Comment


      • #4
        Re: Linear workflow setup

        Hi Arquitecto,

        I read the post you linked and it explains it really well, though I wonder whether the reason why he uses LWF button here though is that (unless I'm wrong) colour management was fully implemented in blender more recently than that post. If you go to Blender internal and look under scene settings>colour management you see options for display and render output gamma. HOWEVER, the Vray exporter blanks these settings, so I'm not sure whether it uses these hidden settings or has its own fixed settings. In any case, the vray exporter seems to remove gamma from colour picker colours for correct use in the render engine, add adds the gamma back at the end, so colours come out correctly.

        I think the difference between gamma corrected and linear might be as explained here:

        http://help.chaosgroup.com/vray/help/ma ... .htm#gamma

        I think 'gamma' option referred to here correpsonds to 'gamma corrected' in Andrei's exporter. Also, the reason there is a speparate input for gamma and srgb is that srgb is different to gamma 2.2 as described here:

        http://en.wikipedia.org/wiki/SRGB

        sRGB is the colour space which most texture images / photos and internet images are stored in, so it makes sense to have this preset. You can see the difference between an image output with gamma 2.2 and sRGB images by playing around with photoshop and outputing a gamma encoded render to sRGB (the colour change a bit). You will also run into problems with images displayed in window picture viewer vs a web browser, which is why sRGB is so good, it suits your screen and is a popular standard, though for professional work, many designers use Abobe 98. This is the reason I use PDFs for all commercial work - it means you can convert to Adobe 98 format in PS and embed that with the file in inDesign, so Acrobat interprets the colour correctly for the screen, as long as exprt settings are all set up well. Also, I'm not sure why, but it seems that the VFB displays colours slightly differently to how it appears when the file is opened in editting software, but this could be because it use gamma of 2.2, instead of sRGB to output.

        Perhaps the best way to work is to render with output gamma of 1.0 to an exr file, and press the sRGB button in VFB while renderring to preview colour reproduction. Then, do primary colour and gamma corrections in blender compositor, and output ot an sRGB file for final workup in GIMP / PS.

        I'm really keen to see what you think of my thoughts on this - its a big deal getting good colour reproduction, especially if you have work with requires you to show corporate colours in your images. Also, please let me know if you have any corrections / ideas about the above.

        Kind Regards,


        Rob.

        EDIT: Just seen what you mean about two colour space options. The one under image is the space of the image on disk and the other (under bitmap) says its Bitmap buffer colour space. I will run some experiments next week and try to work out how this all works - now I'm confused too!

        R

        Comment


        • #5
          Re: Linear workflow setup

          Hi,

          I was going to wait till Monday, but it was bothering me, so I went into the office, and now I've got the answers, and clarified some points I definitely had wrong.

          1. Changing the colour space under Textures>Image panel makes no difference to the final render, only how blender previews the image in viewport / texture preview window. Only the colour settings under the Textures>Bitmap panel affect how VRay renders the texture.

          2. Using sRGB or Linear causes Vray to disregard any value inserted into the global input gamma or gamma value box if this is not ticked. This is slightly confusing as the option to use global input gamma correction or specify gamma correction is still visible in the panel.

          3. Input gamma, if you're going to use this for gamma 2.2 needs to be added as .4545 or 1/gamma value. sRGB is approximately 2.2, so I inserted .454545. I tested with a sRGB texture, and this appears to work properly (as sRGB is similar to gamma of 2.2). Using an input gamma value of 2.2 gives a very wrong result (image renders as near white). Therefore, the input gamma is the correction value, not the value of gamma used in the texture. This means my above post was wrong, but I have put a note on it, as an edit - Input gamma needs to be .4545 for gamma 2.2 images, but in most cases, just use sRGB, which has better colour accuracy than the approximation of correcting gamma 2.2 and overides the gamma correction value. I never noticed this as all my textures use sRGB or Linear, I hardly ever use gamma correction values.

          Sorry if this is confusing, but I hope it helps - still keen to see if this is helpful.

          Regards,

          Rob

          Comment


          • #6
            Re: Linear workflow setup

            Hi,

            Thank you very much for your kind and dedicated analysis.
            It seems we are getting to some conclusions here.

            My objective is far from getting exact color match. My sole purpose is to find a physically correct light flow across the space. Nothing more. And we can oly achieve this with a linear workflow.

            So, usually everyone uses on their scenes some hdr (wich is linear) and some other jpg and png images (wich are srgb).
            So in order to make it easy to calculate the linear workflow, I think it's easier to put the general input gamma at 1 and output gamma at 2.2 ( if we don't publish any exr format)

            This way we restrict the issue to the texture input on each texture.
            We both agree that the input/color space does nothing on the vray render, so let's forget it.

            So we wiil test only the bitmap/colorspace.
            When it comes to hdr, it's easy to conclude that linear gives us physical correct results or gamma corrected at 1(wich is the same)
            So let's focus on the jpg textures.
            With my general setup above, linear has exact same result as gamma corrected with input thicked wich seems to give incorrect results.
            With my general setup above, srgb has exact same result as gamma corrected with gamma at 0.4545 wich seems it gives correct color variety.

            We are getting closer to some conclusions because I am now only testing the bitmap/colorspace with jpg but I am not fully satisfied with the answers.
            What are your thoughts on this. Do you agree?

            Sincere thanks for your work.
            Arquitecto is just a very nice architect in Portugal ...

            Comment


            • #7
              Re: Linear workflow setup

              I agree. Hopw it works now! .

              Rob

              Comment


              • #8
                My entry
                Click image for larger version

Name:	12345.jpg
Views:	1
Size:	523.0 KB
ID:	854496

                Comment


                • #9
                  Hello Folks

                  I did set up simple scene with 3 cubes and area ligt(size 20m, intens 35), to run some test with gamma.
                  Firs cube is just plain 50% gray color, second cube holds 50% gray png texture, and last one holds 50% gray exr map.

                  With default setup everything should look like on image below:

                  Click image for larger version

Name:	defalult.png
Views:	1
Size:	120.9 KB
ID:	854508

                  We would like to have our renders ready to display on to monitors, so we have to set gamma to 2.2 inside vray's color mapping gamma.

                  So now we have something like beneath:

                  Click image for larger version

Name:	gamma 22.png
Views:	1
Size:	121.1 KB
ID:	854509

                  But still our exr seems to be to dark. Keep in mind that image texture nodes are default.
                  To make exr works as it should, all you need to do is to change its color space from sRGB to Linear, under vray settings.

                  Click image for larger version

Name:	exr.png
Views:	1
Size:	138.5 KB
ID:	854511

                  And you should get something like this:

                  Click image for larger version

Name:	gamma 22 with fix exr.png
Views:	1
Size:	118.7 KB
ID:	854512

                  Thats at least the way I am working. If you do not like to apply gamma 2.2 to your image during rendering, you should not change gamma back to 1, but instead of this check addaptation only to allow vray compute every thing with gamma, but not applaying it to final image.

                  Hope I helped somehow.

                  If someone found I am wrong please give me notice, and maybe explain how to set up blender and vray to get proper preview, output and input gamma.

                  Greetings

                  Grzegorz
                  Attached Files

                  Comment


                  • #10
                    mrG_Grm, I would like to follow the same workflow to check my settings and make sure I am adhering to a linear workflow but one question. How would I go about making a 50% grey exr map?

                    Comment


                    • #11
                      Well. I have used PS for that: Open new file, click Image/Mode/32 bit/channel, then in first color picker set up HSB as 0/0/50. Just after that hit Alt + Del, and you get your image filed with this color.

                      Comment


                      • #12
                        Thank you so much!

                        Comment


                        • #13
                          mrG_Grm,

                          I am having a heck of a time getting a linear workflow. Before I ask for help I would like to verify that I am setting up the material in Blender properly. What is 50% grey when the Color Mapping is set to Linear with Gamma set to 2.2?
                          I thought that RGB 0.5 was 50% grey, but now I am starting to wonder. The HEX value is BCBCBC and says (Gamma Corrected). Anyway, if you could please confirm what 50% grey is/was it your test, I would appreciate it.Click image for larger version

Name:	50PercentGrey.jpg
Views:	1
Size:	31.8 KB
ID:	860192

                          Comment


                          • #14
                            Here you have my test scene with packed textures:
                            http://www.megafileupload.com/n8dD/untitled.blend

                            Like I wrote back then I am not an expert with gamma and staff. I do not know if it is scientifically correct I am rather having the artistic approach - what looks ok to my eyes.
                            I havent use rgb values, only hsv.

                            Raw color (in blender) - 808080
                            PNG text - 808080
                            exr text - BCBCBC

                            I guess thats the way it works

                            What I found now, its that you dont have to switch in texture/vray settings from sRGB to Linear when using exr. Do not know why.

                            One last thing, as an advice: Set it up once, and never come back to it. You will have less headaches and more time to work on your stuff

                            Cheers

                            Comment


                            • #15
                              Thanks for the .blend file and the additional info.

                              When I render your scene, I get a different output.

                              Click image for larger version

Name:	Original.jpg
Views:	1
Size:	14.6 KB
ID:	860194

                              I am pretty sure that there have been enough changes to V-Ray for Blender that it explains why that is the case. For instance (and please correct me if I am wrong) I don't think that NTClassic_Texture...node is even available or used anymore.

                              I updated the materials for the .png and .exr so that they each have an Image File node connected to a VRayMtl node connected to a Single Material node connected to the Material Output.
                              BTW..what is the purpose of the Single Material node and is it even absolutely necessary to have any node between the VRayMtl node output and the Material Output node's Material input? I noticed no difference with or without it.

                              Click image for larger version

Name:	PNG_Updated.png
Views:	1
Size:	133.1 KB
ID:	860195

                              With the updated materials, here is what I get as a render result:

                              Click image for larger version

Name:	Updated.jpg
Views:	1
Size:	26.2 KB
ID:	860196

                              I tried all kinds of different configurations and I get nothing different. So what I am getting with your old scene and my tests are the same...I am not able to get all three materials to render the same. I would love to figure out how to do that so that I could "set it and forget it" and move on to the actual art.

                              Can you please help me figure this out?

                              Comment

                              Working...
                              X