ReShade::PixelSize

  • Posts: 2
1 year 3 months ago #1 by sYNTHwAVE88
I'm curious why 1.0 / ReShade::ScreenSize is significantly more precise than ReShade::PixelSize
It's really noticeable on the horizontal axis

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

  • Posts: 154
1 year 3 months ago - 1 year 3 months ago #2 by seri14
How was it output
float2 A = 1.0 / ReShade::ScreenSize;
float2 B = ReShade::PixelSize;
[Statistics] -> [Show HLSL/GLSL]

My case (this is lower than FLT_EPSILON)
const float2 _50 = float2(0.00099206, 0.00131406);
float2 A;
A = _50;
const float2 _52 = float2(0.00099200, 0.00131400);
float2 B;
B = _52;

[Edit]
I guess out of precision was trimmed at float2(BUFFER_RCP_WIDTH, BUFFER_RCP_HEIGHT).
float precision is about 6 digits.
202px
A = 0.00495049 ... 202.000206
B = 0.00495000 ... 202.020202
3840px
A = 0.00026042 ... 3839.95
B = 0.00026000 ... 3846.15

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

  • Posts: 154
1 year 3 months ago #3 by seri14
Maybe I found the answer.
see line of pp.add_macro_definition("BUFFER_RCP_WIDTH", ...) in runtime.cpp.
The std::to_string(float) is using _scprintf("%f", ...).
default output float format precision is 6 digits. (see MSDN Format specification syntax: printf and wprintf functions )
The following user(s) said Thank You: crosire, brussell

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