White point adjuster

  • crabshank
  • Topic Author
More
4 years 8 months ago - 3 years 2 months ago #1 by crabshank White point adjuster was created by crabshank
This shader allows you to change the white point in the xyY space of CIE 1931 and thus allows for easy white balancing:






N.B. This white balances to D65.

So the new aforementioned 2D input works when you toggle the 2D input tickbox and you move the mouse to change the current xy values which are printed at the top of the frame. If you click the left mouse button, it will show the output at the xy point specified in the UI and its screen position.

So, move the mouse to find your desired xy co-ordinates and then set the drags in the UI accordingly.

UPDATE: I've just added a new 2D input that lets you put your mouse over a pixel and it will give you the xy co-ordinates necessary to turn that pixel grey.

I've added the option to switch betweeen crosshairs and just a square for the 2D input display. I've also updated the modded DrawText header file.

I've made a new debug and adjustable range (on the screen) for the 2D input. The debug is based on GIMP's max RGB, It's very senstive and still goes close to black when it goes closer to grey.



Download  here

No debug version  here

"DrawText_mod.fxh" also required, you can find that in the same repo as the above links.
Last edit: 3 years 2 months ago by crabshank. Reason: Added new debug mode.
The following user(s) said Thank You: MaxG3D, jas01, andrew, Marty, Raughie

Please Log in or Create an account to join the conversation.

  • crabshank
  • Topic Author
More
4 years 8 months ago #2 by crabshank Replied by crabshank on topic White point adjuster
I am going to be rewriting all my code to optimise it, this is the first shader for which I have done that and I hope it's better. This code also has new elements in the conversion matrices that should be more accurate.

Please Log in or Create an account to join the conversation.

  • crabshank
  • Topic Author
More
4 years 7 months ago - 4 years 7 months ago #3 by crabshank Replied by crabshank on topic White point adjuster
UPDATE:
I have added debug amplification (exaggerates the differences between values close to grey) to non-RGB debug mode as well.
Last edit: 4 years 7 months ago by crabshank.
The following user(s) said Thank You: jas01

Please Log in or Create an account to join the conversation.

  • Marty McFly
More
4 years 7 months ago - 4 years 7 months ago #4 by Marty McFly Replied by Marty McFly on topic White point adjuster
For some reason I thought this bar on the left side was some white scale UI you draw with the shader and was like "wait wtf, you shittin me" :P



Much needed effect, a lot of games impose stupid simple color filters and getting rid of them is annoying.
Btw, for your consideration:

XYZ.x = 0.4124564*rgbNew.r + 0.3575761*rgbNew.g + 0.1804375*rgbNew.b;

and

XYZ.x = dot(float3(0.4124564,0.3575761, 0.1804375), rgbNew.rgb)

are same and second one is much faster and iirc also how the matrix muls are implemented. If not, consider converting to dot products as well to speed it up. Not that it matters much for this lightweight filter, but maybe good to know.
Last edit: 4 years 7 months ago by Marty McFly.
The following user(s) said Thank You: crabshank

Please Log in or Create an account to join the conversation.

  • crabshank
  • Topic Author
More
4 years 7 months ago - 4 years 7 months ago #5 by crabshank Replied by crabshank on topic White point adjuster
Updated code ^.

Thanks for that @Marty Mcfly, I checked all my other code for such dot products but I couldn't find any. I decided to keep the muls for readibility and compactness, rather than line after line of dot().

All I need now is a 2D drag UI for the xy points *fingers crossed*.
Last edit: 4 years 7 months ago by crabshank.

Please Log in or Create an account to join the conversation.

  • crabshank
  • Topic Author
More
4 years 6 months ago - 4 years 6 months ago #6 by crabshank Replied by crabshank on topic White point adjuster
UPDATE: Added 2D input.

Thanks to BlueSkyDefender and kingeric1992 on Discord for their help.
Last edit: 4 years 6 months ago by crabshank.
The following user(s) said Thank You: jas01

Please Log in or Create an account to join the conversation.

  • crabshank
  • Topic Author
More
4 years 6 months ago #7 by crabshank Replied by crabshank on topic White point adjuster
UPDATE: Option for a square instead of crosshairs for the 2D input added, and also I've changed my modded DrawText header file (I've also done the same for Grey Gamma and Line Thinning).

Please Log in or Create an account to join the conversation.

  • crabshank
  • Topic Author
More
4 years 6 months ago #8 by crabshank Replied by crabshank on topic White point adjuster
UPDATE: I've just added a new 2D input that lets you put your mouse over a pixel and it will give you the xy co-ordinates necessary to turn that pixel grey, for easier white balancing.

I've also removed a little bit of bloat from the code.
The following user(s) said Thank You: jas01

Please Log in or Create an account to join the conversation.

  • crabshank
  • Topic Author
More
4 years 6 months ago #9 by crabshank Replied by crabshank on topic White point adjuster
URGENT UPDATE: Fixed the issues that were giving inaccurate results for the direct point-based input.

Please Log in or Create an account to join the conversation.

  • crabshank
  • Topic Author
More
4 years 3 months ago #10 by crabshank Replied by crabshank on topic White point adjuster
Added version without debugging, for more speed.

Please Log in or Create an account to join the conversation.

  • crabshank
  • Topic Author
More
4 years 1 month ago #11 by crabshank Replied by crabshank on topic White point adjuster
UPDATE: Removed bloat.

Please Log in or Create an account to join the conversation.

We use cookies
We use cookies on our website. Some of them are essential for the operation of the forum. You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.