Giter VIP home page Giter VIP logo

Comments (7)

Tom94 avatar Tom94 commented on September 26, 2024

Hi Wenzel, I can't reproduce the issue on my macbook, unfortunately -- the pixels just keep getting brighter and eventually saturate to white. The attached screen recording is representative of what I see.

Screen.Recording.2022-01-11.at.17.04.07.mov

You can also see flickering that I've started to experience since switching my M1 Max that I mentioned recently. Seems at first like a separate issue (no overflow behavior), but who knows -- might be related in the end.

from tev.

Tom94 avatar Tom94 commented on September 26, 2024

Before I start digging deeper into tev, could you check whether the same overflow occurs when cranking the brightness in one of the nanogui samples? Thanks!

from tev.

wjakob avatar wjakob commented on September 26, 2024

It's on a Pro Display XDR in my case, but with the not-quite-latest macOS version (which may be relevant here, Apple has been doing a lot of work on HDR support in the OS). I plan to give this another try with Monterey when I receive my M1 machine in February. (Busy with the SIGGRAPH deadline until then, too .. ;-))

from tev.

Tom94 avatar Tom94 commented on September 26, 2024

Heh, no hurry (and a successful crunch!).

Another thought: if the overflow indeed happens at reasonably large values (e.g. an eye-searing 64k), I'm happy to add clamping in any case -- just let me know if you find a specific value.

from tev.

wjakob avatar wjakob commented on September 26, 2024

The magic value seems to be 64, and this fixes it:

diff --git a/src/UberShader.cpp b/src/UberShader.cpp
index 91d9a8a..68b4d88 100644
--- a/src/UberShader.cpp
+++ b/src/UberShader.cpp
@@ -355,9 +355,8 @@ UberShader::UberShader(RenderPass* renderPass) {
                         ),
                         1.0f
                     );
-                    if (clipToLdr) {
-                        color.rgb = clamp(color.rgb, 0.0f, 1.0f);
-                    }
+                    color.rgb = clamp(color.rgb, clipToLdr ? 0.f : -64.f,
+                                                 clipToLdr ? 1.f :  64.f);
                     return color;
                 }
 
@@ -377,9 +376,8 @@ UberShader::UberShader(RenderPass* renderPass) {
                     ),
                     1.0f
                 );
-                if (clipToLdr) {
-                    color.rgb = clamp(color.rgb, 0.0f, 1.0f);
-                }
+                color.rgb = clamp(color.rgb, clipToLdr ? 0.f : -64.f,
+                                             clipToLdr ? 1.f :  64.f);
                 return color;
             })";
 #endif

from tev.

wjakob avatar wjakob commented on September 26, 2024
FullSizeRender.MOV

Here is that that looks like by the way.

from tev.

Tom94 avatar Tom94 commented on September 26, 2024

Thanks for checking! 64 seems rather low, to be honest, but still a factor of ~4 above what my highest dynamic range display (the laptop) can output. So... I doubt the extra clamp affects anyone as of now. :)

from tev.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.