Announcement

Collapse
No announcement yet.

Much lower quality of LDR vs HDR in Render Target.

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

    Much lower quality of LDR vs HDR in Render Target.

    Hi,

    Working on some Post Process materials, I noticed that LDR renders are much lower quality than HDR when you use a Render Target assigned to a scenecapture actor.

    Here is an example: i assigned this simple post process material to a post process volume.

    Click image for larger version

Name:	Simple_PP_Mat.jpg
Views:	1
Size:	159.1 KB
ID:	1151947



    So, 2 renders of the same scene: on the left, the player camera, on the right, the scenecapture component attached to this camera.



    With the scenecapture set to HDR, i get this:

    Click image for larger version

Name:	HDR.jpg
Views:	1
Size:	45.9 KB
ID:	1152003


    e.g. absolutely no difference between the 2 renders. Neat!



    and when I set it to LDR with postprocess, i get this:

    Click image for larger version

Name:	LDR.jpg
Views:	1
Size:	57.1 KB
ID:	1152004



    which is obviously weird compared to the first.

    In version 4.8 you can tweak new parameters, like gamma, gain, offset, temperature, which I did here because contrast and colours are initially awful.
    But the image remains grainy, strongly compressed. Almost GIF quality!

    For the moment, I used LDR renders, as I was blurring them, so the loss of quality wasn't a big problem. Visually, it was acceptable. But now I need a better quality.

    I could use HDR but in this case, I loose the possibility to use postprocess settings of the scenecapture actor to tweak my render.

    Ideally, I would need something like a "HDR with postprocess" feature.

    So my questions are:

    - Why LDR renders are so weird compared to HDR? Is it because of compression?
    - Is there really no way to improve them significantly, remove the grain?
    - Ideally, is there a way to have HDR with postprocess as a render for scenecapture actors?

    Thanks.
    Last edited by EdWasHere; 06-19-2015, 08:32 AM.
    GLASSES & WATER SHADERS & CUSTOM PLANAR REFLECTIONS on my Youtube Channel: https://www.youtube.com/channel/UCP2...26Y2bEV4kfl9kA

    #2
    Is there a way to skip the conversion HDR --> LDR, and keep initial quality?
    Digging in code, for example.
    GLASSES & WATER SHADERS & CUSTOM PLANAR REFLECTIONS on my Youtube Channel: https://www.youtube.com/channel/UCP2...26Y2bEV4kfl9kA

    Comment


      #3
      I say: bump.
      GLASSES & WATER SHADERS & CUSTOM PLANAR REFLECTIONS on my Youtube Channel: https://www.youtube.com/channel/UCP2...26Y2bEV4kfl9kA

      Comment


        #4
        I had to do this myself in 4.7.6.
        Assuming your happy compiling from github.

        You would find need to add a bool property to USceneCaptureComponent within USceneCaptureComponent.h.

        UPROPERTY(EditAnywhere, Category = SceneCapture, meta = (DisplayName = "Disable Tonemapper"))
        bool bDisableToneMapper = false;
        and within the FScene::CreateSceneRenderer() function within SceneCaptureRendering.cpp
        after the

        if (bCaptureSceneColour)
        {
        ViewFamily.EngineShowFlags.PostProcessing = 0;
        ViewInitOptions.OverlayColor = FLinearColor::Black;
        }
        add

        if (SceneCaptureComponent->bDisableToneMapper) {
        ViewFamily.EngineShowFlags.SetTonemapper(false);
        }
        If you now disable the tonemapper on the scenecapturecomponent with LDR(with post-process) enabled you will get HDR with post-process.

        Edit* the other option is to set your post-process to happen after the tonemapper if possible.
        I however was in a situation where this was'nt possible.
        Last edited by Opamp77; 06-25-2015, 09:07 PM.

        Comment


          #5
          Thanks a lot ! I'll test it tonight and give you feedback.
          GLASSES & WATER SHADERS & CUSTOM PLANAR REFLECTIONS on my Youtube Channel: https://www.youtube.com/channel/UCP2...26Y2bEV4kfl9kA

          Comment


            #6
            If you now disable the tonemapper on the scenecapturecomponent with LDR(with post-process) enabled you will get HDR with post-process.
            Well, I did what you described, checked everything, compiled but infortunately, it doesn't have the effect it is supposed to have.
            Image is still LDR. No doubt about this: same quality, same grain, etc...
            Last edited by EdWasHere; 06-30-2015, 05:10 AM.
            GLASSES & WATER SHADERS & CUSTOM PLANAR REFLECTIONS on my Youtube Channel: https://www.youtube.com/channel/UCP2...26Y2bEV4kfl9kA

            Comment


              #7
              @Opamp77:

              Ok, so after our few P.M, here is what I get.
              I'll make it very detailled so that it will be as clear as possible:

              After adding your lines of code and compiling, I made a basic postprocess material with a render texture plugged in the emissive channel for testing purposes:

              Click image for larger version

Name:	PP_Mat_Setup.jpg
Views:	1
Size:	97.3 KB
ID:	1081028



              this postprocess material is assigned as blendable to the camera of a third person character.

              I also added a scenecapture component to this third person character and assigned the render target to this component.



              Now:

              1 ° - If I launch the level, with scenecapture set to HDR, I get this:

              Click image for larger version

Name:	SceneCapture_HDR_View.jpg
Views:	1
Size:	112.9 KB
ID:	1081029

              which is the equivalent of a camera view.



              2° - If I launch the level with scencapture set to LDR with tonemapper enabled (so: "Disable Tonemapper" UNCHECKED), I get this:

              Click image for larger version

Name:	SceneCapture_LDR_With_Tonemapping_Enabled.jpg
Views:	1
Size:	175.1 KB
ID:	1081030

              which is what you normally get with this option.



              3° - If I launch the level with scenecapture set to LDR with tonemapper disabled (so: "Disable Tonemapper" CHECKED), I get this:

              Click image for larger version

Name:	SceneCapture_LDR_With_Tonemapping_Disabled.jpg
Views:	1
Size:	128.8 KB
ID:	1081031



              So, as I told you, disabling tonemapper really does something and it's better than the second screenshot.
              Colors are the same but gradients are modifed: you no longer have these smooth transitions between values.
              You see what I mean as it's obvious.
              Last edited by EdWasHere; 07-03-2015, 11:31 AM.
              GLASSES & WATER SHADERS & CUSTOM PLANAR REFLECTIONS on my Youtube Channel: https://www.youtube.com/channel/UCP2...26Y2bEV4kfl9kA

              Comment


                #8
                The only way i could recreate image 3 was to disable hdr with the render textures settings.

                scenecapture before,


                disable hdr option,


                scenecapture Image after,


                It might be worth checking your texture settings.

                Comment


                  #9
                  In the 3 screenshots i posted, HDR was checked in the render target settings.
                  Otherwise, the first screenshot would have been as weird as the third.
                  I don't understand. You tell me it works and, on my side, it doesn't.
                  Maybe a hardware issue...
                  Or maybe : i compiled using "build UE4" on a source code already modified and built 2 times for other reasons. Should I use "rebuild" ? Could it make any difference ?
                  Last edited by EdWasHere; 07-04-2015, 05:17 AM.
                  GLASSES & WATER SHADERS & CUSTOM PLANAR REFLECTIONS on my Youtube Channel: https://www.youtube.com/channel/UCP2...26Y2bEV4kfl9kA

                  Comment


                    #10
                    I'd be interested to see if it is a hardware issue, i'll upload a shipping build of my test project tommorrow for you to test out.

                    Comment


                      #11
                      Ok, great.
                      GLASSES & WATER SHADERS & CUSTOM PLANAR REFLECTIONS on my Youtube Channel: https://www.youtube.com/channel/UCP2...26Y2bEV4kfl9kA

                      Comment

                      Working...
                      X