Jump to content

ToneMapping Blurs Results


SpiderPig
 Share

Go to solution Solved by klepto2,

Recommended Posts

@klepto2 and I had a discussion on discord about the Tone Mapping post effect blurring the result.  It's really easy to tell if you load these images in Microsoft paint and zoom into a particular section.  You'll see that the pixels have defiantly been blurred with the post effect.

Not sure if this is just Nvidia or not.  I'm using a GTX 980 TI.

I fixed the blur by changing this:

vec2 coord = ivec2(gl_FragCoord.x, gl_FragCoord.y) / vec2(DrawViewport.z, DrawViewport.w);

To this:

vec2 coord = vec2(gl_FragCoord.x, gl_FragCoord.y) / vec2(DrawViewport.z, DrawViewport.w);

Klepto also suggest this might be better:

void main()
{
    ivec2 coord = ivec2(gl_FragCoord.x, gl_FragCoord.y);
    outColor = texelFetch(ColorBuffer, coord,0);
    outColor.rgb = aces(outColor.rgb);
}

Before:

22_05_2024_16_36_27_Screenshot.thumb.png.9473f503f707dd2fda28646f86f2d165.png

After:

22_05_2024_16_36_52_Screenshot.thumb.png.359bc45187601aa117421199ef507fdb.png

Also you may notice that when the post effect is applied Framebuffer::Capture() no longer get's the stuff from the 2nd UI camera... that may be another bug report though.

Link to comment
Share on other sites

  • Solution

small correction:

void main()
{
    ivec2 coord = ivec2(gl_FragCoord.x, gl_FragCoord.y);
    outColor = texelFetch(ColorBuffer, coord,gl_SampleID);
    outColor.rgb = aces(outColor.rgb);
}

this also uses the sampleID, which might be better in this case.

  • Upvote 1
  • Windows 10 Pro 64-Bit-Version
  • NVIDIA Geforce 1080 TI
Link to comment
Share on other sites

6 hours ago, klepto2 said:

this also uses the sampleID, which might be better in this case.

In earlier builds, yes. In more recent builds I changed it so the MSAA resolve happens at the beginning of the post-processing chain. The reason for this is that the depth buffer is the only texture that really needs to retain its full resolution, and the shaders can access that anyways, so only depth-based effects need to worry about this.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...